PHP 클래스 GrumPHP\Collection\FilesCollection

상속: extends Doctrine\Common\Collections\ArrayCollection
파일 보기 프로젝트 열기: phpro/grumphp

공개 메소드들

메소드 설명
date ( string $date ) : FilesCollection Adds tests for file dates (last modified).
extensions ( array $extensions ) : FilesCollection
filter ( Closure $closure ) : FilesCollection Filters the iterator with an anonymous function.
filterByFileList ( Traversable $fileList ) : FilesCollection
name ( string | Regex $pattern ) : FilesCollection Adds rules that files must match.
notName ( string $pattern ) : FilesCollection Adds rules that files must match.
notPath ( string $pattern ) : FilesCollection Adds rules that filenames must not match.
path ( string $pattern ) : FilesCollection Filter by path
paths ( array $patterns ) : FilesCollection Filter by paths
size ( string $size ) : FilesCollection Adds tests for file sizes.

메소드 상세

date() 공개 메소드

The date must be something that strtotime() is able to parse: $collection->filterByDate('since yesterday'); $collection->filterByDate('until 2 days ago'); $collection->filterByDate('> now - 2 hours'); $collection->filterByDate('>= 2005-10-15');
또한 보기: DateComparator
public date ( string $date ) : FilesCollection
$date string A date to test
리턴 FilesCollection

extensions() 공개 메소드

public extensions ( array $extensions ) : FilesCollection
$extensions array
리턴 FilesCollection

filter() 공개 메소드

The anonymous function receives a \SplFileInfo and must return false to remove files.
또한 보기: CustomFilterIterator
public filter ( Closure $closure ) : FilesCollection
$closure Closure An anonymous function
리턴 FilesCollection The current Finder instance

filterByFileList() 공개 메소드

public filterByFileList ( Traversable $fileList ) : FilesCollection
$fileList Traversable
리턴 FilesCollection

name() 공개 메소드

You can use patterns (delimited with / sign), globs or simple strings. $collection->name('*.php') $collection->name('/\.php$/') // same as above $collection->name('test.php')
public name ( string | Regex $pattern ) : FilesCollection
$pattern string | GrumPHP\Util\Regex A pattern (a regexp, a glob, or a string)
리턴 FilesCollection

notName() 공개 메소드

You can use patterns (delimited with / sign), globs or simple strings. $collection->name('*.php') $collection->name('/\.php$/') // same as above $collection->name('test.php')
public notName ( string $pattern ) : FilesCollection
$pattern string A pattern (a regexp, a glob, or a string)
리턴 FilesCollection

notPath() 공개 메소드

You can use patterns (delimited with / sign) or simple strings. $collection->notPath('/^spec\/')
public notPath ( string $pattern ) : FilesCollection
$pattern string
리턴 FilesCollection

path() 공개 메소드

$collection->path('/^spec\/')
public path ( string $pattern ) : FilesCollection
$pattern string
리턴 FilesCollection

paths() 공개 메소드

$collection->paths(['/^spec\/','/^src\/'])
public paths ( array $patterns ) : FilesCollection
$patterns array
리턴 FilesCollection

size() 공개 메소드

$collection->filterBySize('> 10K'); $collection->filterBySize('<= 1Ki'); $collection->filterBySize(4);
또한 보기: NumberComparator
public size ( string $size ) : FilesCollection
$size string A size range string
리턴 FilesCollection