PHP Class Go\Instrument\FileSystem\Enumerator

Afficher le fichier Open project: goaop/framework Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $rootDirectory, array $includePaths = [], array $excludePaths = [] ) Initializes an enumerator
enumerate ( ) : CallbackFilterIterator | RecursiveIteratorIterator | SplFileInfo[] Returns an enumerator for files
getFilter ( ) : Closure Returns a filter callback for enumerating files

Méthodes protégées

Méthode Description
getFileFullPath ( SplFileInfo $file ) : string Return the real path of the given file

Method Details

__construct() public méthode

Initializes an enumerator
public __construct ( string $rootDirectory, array $includePaths = [], array $excludePaths = [] )
$rootDirectory string Path to the root directory
$includePaths array List of additional include paths
$excludePaths array List of additional exclude paths

enumerate() public méthode

Returns an enumerator for files

getFileFullPath() protected méthode

This is used for testing purpose with virtual file system. In a vfs the 'realPath' methode will always return false. So we have a chance to mock this single function to return different path.
protected getFileFullPath ( SplFileInfo $file ) : string
$file SplFileInfo
Résultat string

getFilter() public méthode

Returns a filter callback for enumerating files
public getFilter ( ) : Closure
Résultat Closure