src/Lib/Scanner.php
protected static function setupIterator($path): Iterator
    {
        return new RegexIterator(new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator(
                $path,
                FilesystemIterator::KEY_AS_PATHNAME |
                FilesystemIterator::CURRENT_AS_FILEINFO |
                FilesystemIterator::SKIP_DOTS
            ),
            RecursiveIteratorIterator::CHILD_FIRST,
            RecursiveIteratorIterator::CATCH_GET_CHILD
        ), '/.*?' . TwigView::EXT . '$/', RegexIterator::GET_MATCH);
    }
protected static function setupIterator($path): Iterator
    {
        return new RegexIterator(new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator(
                $path,
                FilesystemIterator::KEY_AS_PATHNAME |
                FilesystemIterator::CURRENT_AS_FILEINFO |
                FilesystemIterator::SKIP_DOTS
            ),
            RecursiveIteratorIterator::CHILD_FIRST,
            RecursiveIteratorIterator::CATCH_GET_CHILD
        ), '/.*?' . TwigView::EXT . '$/', RegexIterator::GET_MATCH);
    }
protected static function setupIterator ( $ path ) : Iterator { return new RegexIterator ( new RecursiveIteratorIterator ( new RecursiveDirectoryIterator ( $ path , FilesystemIterator :: KEY_AS_PATHNAME | FilesystemIterator :: CURRENT_AS_FILEINFO | FilesystemIterator :: SKIP_DOTS ) , RecursiveIteratorIterator :: CHILD_FIRST , RecursiveIteratorIterator :: CATCH_GET_CHILD ) , '/.*?' . TwigView :: EXT . '$/' , RegexIterator :: GET_MATCH ) ; }
Setup iterator for given path.

@param string $path Path to setup iterator for.

@return \Iterator
Setup iterator for given path .