PHP Класс GrumPHP\Collection\FilesCollection

Наследование: extends Doctrine\Common\Collections\ArrayCollection
Показать файл Открыть проект

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

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