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:----ZTMrENWyJZIeNjb/7dfGPrduY8ID9RmXP0SnshajrEFJJ5yhpt8CthplVotlGfS4dcvAgg/aKxnTxbcpPrSWPRiZV25LZq3XsLD6TyS42fZ4kd7Csoh+XwWFB43xDXoQd46qF6gEELymrNDK4ieaW5rekIPyYI86gt+5Fj6uj0wRMjPMTQ6BPYVDw8fKaSFwnRmRLwnhBQNFQubUJhaUnVnTKhC/VjEMxuum78+hzmRynymfa1NPjzG9fe0FAOh2i36qs5cyGswhPURA0hWzAWqEifVoGcCOEdqxSVUq6A0V7hdE1YdYJXOn+YHXdI0LhLfwWlkvU9vJG66Do084g7oPcF/toeWRQ5zYK3gmsvbm39W/ZnIv9p0WnNxBjqxNPWR6lWaIx6/FGhNH4xAIZSg5My8OhktSEgX0t2yHlxKVOHjwGzui5C1pMBg3sjnByrtAS+UZS63uWP6Ib7bat83UWZhm6x0b9GQqYSIsxdUdcvZx0rvw9FgmAY7pLTkmCApJAvvOOVuuETiFJFfpkczgl4pcvG+LDm48EBXxR1U9WKoNjyPvH9Y9a+alFuQDVijfrO9DJJS6RYVDmNXO2W/vj4SxPTH7vl6SY8+ZgHtBSFT+9Z7wVsiQB3C9+jWMdJC3I8hXuxBDp9iKFz5ZuwKHiptwmnq4ppsgJzFlnbg=----ATTACHMENT:----MzA1MTUxODYyNjY0Mjc4NCA5MTAyNTY3MTU5NzU5NjIzIDY4NTYwNjc0ODk1MjIyNjM=