src/Lib/Scanner.php
protected static function walkIterator(Iterator $iterator): array
    {
        $items = [];

        $array = iterator_to_array($iterator);
        uasort($array, function ($a, $b) {
            if ($a == $b) {
                return 0;
            }

            return $a < $b ? -1 : 1;
        });

        foreach ($array as $paths) {
            foreach ($paths as $path) {
                $items[] = $path;
            }
        }

        return $items;
    }
protected static function walkIterator(Iterator $iterator): array
    {
        $items = [];

        $array = iterator_to_array($iterator);
        uasort($array, function ($a, $b) {
            if ($a == $b) {
                return 0;
            }

            return $a < $b ? -1 : 1;
        });

        foreach ($array as $paths) {
            foreach ($paths as $path) {
                $items[] = $path;
            }
        }

        return $items;
    }
protected static function walkIterator ( Iterator $ iterator ) : array { $ items = [ ] ; $ array = iterator_to_array ( $ iterator ) ; uasort ( $ array , function ( $ a , $ b ) { if ( $ a == $ b ) { return 0 ; } return $ a < $ b ? - 1 : 1 ; } ) ; foreach ( $ array as $ paths ) { foreach ( $ paths as $ path ) { $ items [ ] = $ path ; } } return $ items ; }
Walk over the iterator and compile all templates.

@param \Iterator $iterator Iterator to walk.

@return array
Walk over the iterator and compile all templates .