PHP 클래스 Psecio\Parse\FileIterator

상속: implements IteratorAggregat\IteratorAggregate, implements Countabl\Countable
파일 보기 프로젝트 열기: psecio/parse

공개 메소드들

메소드 설명
__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

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