PHP Класс MiniAsset\Filter\FilterRegistry

Useful for holding onto loaded filters and creating collections of filters based on specific target requirements.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$filters array The loaded filters.

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

Метод Описание
__construct ( array $filters = [] ) Constructor
add ( string $name, MiniAsset\Filter\FilterInterface $filter ) : void Add a filter to the registry
collection ( AssetTarget $target ) : FilterCollection Get a filter collection for a specific target.
contains ( string $name ) : boolean Check if the registry contains a named filter.
get ( string $name ) : MiniAsset\Filter\FilterInterface | null Get a filter from the registry
remove ( string $name ) : void Remove a filter from the registry

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

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

Constructor
public __construct ( array $filters = [] )
$filters array A list of filters to load.

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

Add a filter to the registry
public add ( string $name, MiniAsset\Filter\FilterInterface $filter ) : void
$name string The filter name to load.
$filter MiniAsset\Filter\FilterInterface The filter to load.
Результат void

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

Get a filter collection for a specific target.
public collection ( AssetTarget $target ) : FilterCollection
$target MiniAsset\AssetTarget The target to get a filter collection for.
Результат FilterCollection

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

Check if the registry contains a named filter.
public contains ( string $name ) : boolean
$name string The filter name to check.
Результат boolean

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

Get a filter from the registry
public get ( string $name ) : MiniAsset\Filter\FilterInterface | null
$name string The filter name to fetch.
Результат MiniAsset\Filter\FilterInterface | null

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

Remove a filter from the registry
public remove ( string $name ) : void
$name string The filter name to remove
Результат void

Описание свойств

$filters защищенное свойство

The loaded filters.
protected array $filters
Результат array