protected function optimizeUnwrap()
    {
        $iterator = $this->unwrap();

        if (get_class($iterator) === ArrayIterator::class) {
            $iterator = $iterator->getArrayCopy();
        }

        return $iterator;
    }
protected function optimizeUnwrap()
    {
        $iterator = $this->unwrap();

        if (get_class($iterator) === ArrayIterator::class) {
            $iterator = $iterator->getArrayCopy();
        }

        return $iterator;
    }
protected function optimizeUnwrap ( ) { $ iterator = $ this -> unwrap ( ) ; if ( get_class ( $ iterator ) === ArrayIterator :: class ) { $ iterator = $ iterator -> getArrayCopy ( ) ; } return $ iterator ; }
Unwraps this iterator and returns the simplest
traversable that can be used for getting the data out

@return \Traversable|array
Unwraps this iterator and returns the simplest traversable that can be used for getting the data out