private static function getAllRemaining(\ArrayIterator $iterator): array
    {
        $values = [];
        while ($iterator->valid()) {
            $values[] = $iterator->current();
            $iterator->next();
        }

        return $values;
    }
private static function getAllRemaining(\ArrayIterator $iterator): array
    {
        $values = [];
        while ($iterator->valid()) {
            $values[] = $iterator->current();
            $iterator->next();
        }

        return $values;
    }
private static function getAllRemaining ( \ ArrayIterator $ iterator ) : array { $ values = [ ] ; while ( $ iterator -> valid ( ) ) { $ values [ ] = $ iterator -> current ( ) ; $ iterator -> next ( ) ; } return $ values ; }
Get all the remaining values of an iterator as an array.

@param \ArrayIterator $iterator

@return array
Get all the remaining values of an iterator as an array .