PHP Класс Puli\Repository\Resource\Iterator\ResourceFilterIterator

You can use the iterator to filter files with a specific extension: php $iterator = new ResourceFilterIterator( new RecursiveResourceIteratorIterator( new ResourceCollectionIterator($collection), ), '.css', ResourceFilterIterator::MATCH_SUFFIX ); foreach ($iterator as $path => $resource) { ... } See {@link __construct} for more information on the filter options.
С версии: 1.0
Автор: Bernhard Schussek ([email protected])
Наследование: extends FilterIterato\FilterIterator, implements Puli\Repository\Api\ResourceIterator
Показать файл Открыть проект

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

Метод Описание
__construct ( Puli\Repository\Api\ResourceIterator $iterator, string $pattern, integer | null $mode = null ) Creates a new iterator.
accept ( ) : boolean | integer Returns whether the current element should be accepted.
getCurrentResource ( )

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

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

The following constants can be used to configure what to filter by: * {@link FILTER_BY_PATH}: The pattern is matched against the paths; * {@link FILTER_BY_NAME}: The pattern is matched against the names. The following constants can be used to configure how to match the selected text: * {@link MATCH_PREFIX}: Tests whether the pattern is a prefix of the matched text; * {@link MATCH_SUFFIX}: Tests whether the pattern is a suffix of the matched text; * {@link MATCH_REGEX}: Treats the pattern as regular expression. By default, the mode FILTER_BY_PATH | MATCH_REGEX is used.
public __construct ( Puli\Repository\Api\ResourceIterator $iterator, string $pattern, integer | null $mode = null )
$iterator Puli\Repository\Api\ResourceIterator The filtered iterator.
$pattern string The pattern to match.
$mode integer | null A bitwise combination of the mode constants.

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

Returns whether the current element should be accepted.
public accept ( ) : boolean | integer
Результат boolean | integer Returns `false` if the current element should be filtered out.

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

public getCurrentResource ( )