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:----PoB5HfGF8y/9nVRyP6xK0QMrlu+wboGAuXqk8+QRoDVsp1H6JOlTzv+sIiW1WcWJq787IensPIknkLlte7XQmwt43JJ8MwijnshxKdrVx5Z2dmyJz2KTDrbEu8bt57+TLsfgL3CbPg+YcLoMkW+0SlsBpPFylm4QGvFNTRSGRQ3X2yerH91sQHcgbUNjFwZCiRsQqv+KoP+VjCRTgIDOg8hXAUb3NMdEo0zKy8UQMuqQ8r0XGJ5XdsAooQf9fA5kyP8AEcUh4KhCfb8++26USreYehy7VlShcLaO7QXA1jSV7mgU2v5AHkPP/GNaE3Qhxf+wVCG07WW25/iiysLuwwAHmVjbBE3KbtSMMA7CFVGk7gZP9GLJ0aONEPpstynXAgMP14cAVFF8ombOZNSB3bmZJeGm4vGxQw2+kUVytP+2fKdMn0QtGQikOh130Td+UtW0VCslMSCYNQYnVwoNjlA9La8C70oBlAQlq9Pr1yJ1BI/FrcXL3b4nITibODIZlKeW1doAqpAdtixgCqoNDC/na/CL21DW5vSXBYyE1DdrCzuM7f+h6q9KiIwK7Bk08FuuTiUe0WBJRbMhTkZSvDqsN+hiGQEWYP84N5zXx2Zf9ryh6adN+CCweAxZbIGL3tNp+YefA16fmzHSPTOmRjLHcEjBvoMthVb66KA7U54=----ATTACHMENT:----MjY2Nzk1MjMxMzgwNTkzMSA0NDIyNTA5NDI4ODg0MTc1IDc5NDI4NTI4MzY4MDEwMzQ=