PHP Class Psecio\Parse\FileIterator

Inheritance: implements IteratorAggregat\IteratorAggregate, implements Countabl\Countable
Afficher le fichier Open project: psecio/parse

Méthodes publiques

Méthode Description
__construct ( array $paths, array $ignorePaths = [], array $extensions = ['php'] ) Append paths to iterator
addExtensions ( array $extensions ) : void Add list of file extensions to include when scanning dirs
addIgnorePath ( string $path ) : void Add a path to the list of ignored paths
addPath ( string $path ) : void Add a path to iterator
count ( ) : integer Return a count of files in iterator
getIterator ( ) : ArrayIterator Get iterator whith file paths as keys and File objects as values
getPaths ( ) : array Get the full paths for the current files
toArray ( ) : array Convert the interator to an array (return current files)

Private Methods

Méthode Description
addDirectory ( string $directory ) : void Recursicely add files in directory
addFile ( SplFileInfo $splFileInfo ) : void Add a SplFileInfo object to iterator
isValidFile ( SplFileInfo $splFileInfo ) : boolean Check of file should be included

Method Details

__construct() public méthode

Append paths to iterator
public __construct ( array $paths, array $ignorePaths = [], array $extensions = ['php'] )
$paths array List of paths to scan
$ignorePaths array List of paths to ignore
$extensions array List of file extensions to include when scanning dirs

addExtensions() public méthode

Add list of file extensions to include when scanning dirs
public addExtensions ( array $extensions ) : void
$extensions array
Résultat void

addIgnorePath() public méthode

Non existing paths are silently skipped.
public addIgnorePath ( string $path ) : void
$path string
Résultat void

addPath() public méthode

Add a path to iterator
public addPath ( string $path ) : void
$path string
Résultat void

count() public méthode

Return a count of files in iterator
public count ( ) : integer
Résultat integer

getIterator() public méthode

Get iterator whith file paths as keys and File objects as values
public getIterator ( ) : ArrayIterator
Résultat ArrayIterator

getPaths() public méthode

Get the full paths for the current files
public getPaths ( ) : array
Résultat array Set of file paths

toArray() public méthode

Convert the interator to an array (return current files)
public toArray ( ) : array
Résultat array Set of current files