public function scanDirectory($directory)
    {
        $extensions = $this->getOption('extensions');

        foreach (scandir($directory) as $object) {
            if ($object === '.' || $object === '..') {
                continue;
            }
            $inputFile = $directory.DIRECTORY_SEPARATOR.$object;
            if (is_dir($inputFile)) {
                foreach ($this->scanDirectory($inputFile) as $file) {
                    yield $file;
                }

                continue;
            }
            if ($this->fileMatchExtensions($object, $extensions)) {
                yield $inputFile;
            }
        }
    }
public function scanDirectory($directory)
    {
        $extensions = $this->getOption('extensions');

        foreach (scandir($directory) as $object) {
            if ($object === '.' || $object === '..') {
                continue;
            }
            $inputFile = $directory.DIRECTORY_SEPARATOR.$object;
            if (is_dir($inputFile)) {
                foreach ($this->scanDirectory($inputFile) as $file) {
                    yield $file;
                }

                continue;
            }
            if ($this->fileMatchExtensions($object, $extensions)) {
                yield $inputFile;
            }
        }
    }
public function scanDirectory ( $ directory ) { $ extensions = $ this -> getOption ( 'extensions' ) ; foreach ( scandir ( $ directory ) as $ object ) { if ( $ object === '.' || $ object === '..' ) { continue ; } $ inputFile = $ directory . DIRECTORY_SEPARATOR . $ object ; if ( is_dir ( $ inputFile ) ) { foreach ( $ this -> scanDirectory ( $ inputFile ) as $ file ) { yield $ file ; } continue ; } if ( $ this -> fileMatchExtensions ( $ object , $ extensions ) ) { yield $ inputFile ; } } }
Get all file matching extensions list recursively in a directory.

@param $directory

@return \Generator
Get all file matching extensions list recursively in a directory .