private static function getFlatFileListIterator($sourcePath)
    {
        $recursiveFileIterator = new \RecursiveDirectoryIterator($sourcePath, \FilesystemIterator::SKIP_DOTS);
        $flatFileListIterator = new \RecursiveIteratorIterator($recursiveFileIterator);

        return $flatFileListIterator;
    }
private static function getFlatFileListIterator($sourcePath)
    {
        $recursiveFileIterator = new \RecursiveDirectoryIterator($sourcePath, \FilesystemIterator::SKIP_DOTS);
        $flatFileListIterator = new \RecursiveIteratorIterator($recursiveFileIterator);

        return $flatFileListIterator;
    }
private static function getFlatFileListIterator ( $ sourcePath ) { $ recursiveFileIterator = new \ RecursiveDirectoryIterator ( $ sourcePath , \ FilesystemIterator :: SKIP_DOTS ) ; $ flatFileListIterator = new \ RecursiveIteratorIterator ( $ recursiveFileIterator ) ; return $ flatFileListIterator ; }
Return an iterator which iterates through a given directory tree in a one-dimensional fashion.

Consider the following file/directory structure as an example:

* directory_a
* file_a_a
* directory_b
* file_b_a
* file_b_b
* file_c

RecursiveDirectoryIterator would iterate through:
* directory_a [iterator]
* directory_b [iterator]
* file_c [SplFileInfo]

In contrast current method would iterate through:
* directory_a [SplFileInfo]
* directory_a/file_a_a [SplFileInfo]
* directory_b [SplFileInfo]
* directory_b/file_b_a [SplFileInfo]
* directory_b/file_b_b [SplFileInfo]
* file_c [SplFileInfo]

@param string $sourcePath Absolute path to directory.

@return \Iterator
Return an iterator which iterates through a given directory tree in a one - dimensional fashion .