PHP Класс Psecio\Parse\FileIterator

Наследование: implements IteratorAggregat\IteratorAggregate, implements Countabl\Countable
Показать файл Открыть проект

Открытые методы

Метод Описание
__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)

Приватные методы

Метод Описание
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

Описание методов

__construct() публичный Метод

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() публичный Метод

Add list of file extensions to include when scanning dirs
public addExtensions ( array $extensions ) : void
$extensions array
Результат void

addIgnorePath() публичный Метод

Non existing paths are silently skipped.
public addIgnorePath ( string $path ) : void
$path string
Результат void

addPath() публичный Метод

Add a path to iterator
public addPath ( string $path ) : void
$path string
Результат void

count() публичный Метод

Return a count of files in iterator
public count ( ) : integer
Результат integer

getIterator() публичный Метод

Get iterator whith file paths as keys and File objects as values
public getIterator ( ) : ArrayIterator
Результат ArrayIterator

getPaths() публичный Метод

Get the full paths for the current files
public getPaths ( ) : array
Результат array Set of file paths

toArray() публичный Метод

Convert the interator to an array (return current files)
public toArray ( ) : array
Результат array Set of current files