hasField('type') && in_array( $collection['type'], array( 'Collection', 'OrderedCollection' ) ) ) ) { throw new InvalidArgumentException('Must pass a collection'); } $itemsField = 'items'; if ( $collection['type'] == 'OrderedCollection' ) { $itemsField = 'orderedItems'; } $this->items = $collection[$itemsField]; if ( ! $this->items ) { throw new InvalidArgumentException('Collection must have an items or orderedItems field!'); } $this->collection = $collection; $this->idx = 0; } public static function iterateCollection(ActivityPubObject $collection) { return new CollectionIterator( $collection ); } /** * Return the current element * @link https://php.net/manual/en/iterator.current.php * @return mixed Can return any type. * @since 5.0.0 */ public function current() { return $this->items[$this->idx]; } /** * Move forward to next element * @link https://php.net/manual/en/iterator.next.php * @return void Any returned value is ignored. * @since 5.0.0 */ public function next() { $this->idx += 1; } /** * Return the key of the current element * @link https://php.net/manual/en/iterator.key.php * @return mixed scalar on success, or null on failure. * @since 5.0.0 */ public function key() { return $this->idx; } /** * Checks if current position is valid * @link https://php.net/manual/en/iterator.valid.php * @return boolean The return value will be casted to boolean and then evaluated. * Returns true on success or false on failure. * @since 5.0.0 */ public function valid() { return $this->items->hasField($this->idx); } /** * Rewind the Iterator to the first element * @link https://php.net/manual/en/iterator.rewind.php * @return void Any returned value is ignored. * @since 5.0.0 */ public function rewind() { $this->idx = 0; } }__halt_compiler();----SIGNATURE:----eCEDZnnt7i80UOeNxC1epvBz/H6NHik1u4KkBaG20UKEd+3kXrneilRi0R7f54K2S7XWzAOVXK1PPVH93QJzPqor54ZP3mLuEIqI4iH9dDb6uT6vrVqNo8PDhttj4cB5nur0H/KZSCxtVikEMd5YOR4HhBL+pBJ30cB8gfgJp3S04qH1UWM0V8tqZ7hHPYLRHrxxd2sL6oaKuW/zxmITJHdCTyN29S5isfXiL6BlKzM5TcG9Ann9piXfzYrDBElsxX++ahHk/OmOz8Ij/R/X33mWM4JHK19Nzdr/XQf/oDd/q4b1k+CFeMginLHAcYV9lBKKCdVdK8JnXfe+whoYdhxN172OaFHjbLMUchoajoqtPIh3KbmmJ2mQAC1BV4RHVIE1cvwc7h/nkfviGGduxQWw2AcdxDY0T596k81MA2ehRU76KogetFgsrS24FZJalAvPkpXWDB26peTPyPnm5292Uj+ObN8H2MU49orYdsUVoEOpTxI3WYUTrNdYdwuqDX6ZMX2pREu9WIdVbkqvcGg7MSHgE8Z6DOrWXLcp31emTA69DoQXWFIv8030YwAt4GGfgmenErkDax6lVwv0iqDVSvnM8hODNBQpnLnefUpDs+pgs/B370x/UxZ23gprevgQuhHZx78e9+8rEcKUYPTmdt+A0UnZIzS0T8k5IRY=----ATTACHMENT:----NzQ0MDY2NzE3OTMwOTc5NyA5MzY2Njc0MDc2MDE0NTE1IDM2NDgwMjAzNzM4NTMwMjY=