PHP Class MiniAsset\Filter\FilterRegistry

Useful for holding onto loaded filters and creating collections of filters based on specific target requirements.
Datei anzeigen Open project: markstory/mini-asset Class Usage Examples

Protected Properties

Property Type Description
$filters array The loaded filters.

Public Methods

Method Description
__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

Method Details

__construct() public method

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

add() public method

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.
return void

collection() public method

Get a filter collection for a specific target.
public collection ( AssetTarget $target ) : FilterCollection
$target MiniAsset\AssetTarget The target to get a filter collection for.
return FilterCollection

contains() public method

Check if the registry contains a named filter.
public contains ( string $name ) : boolean
$name string The filter name to check.
return boolean

get() public method

Get a filter from the registry
public get ( string $name ) : MiniAsset\Filter\FilterInterface | null
$name string The filter name to fetch.
return MiniAsset\Filter\FilterInterface | null

remove() public method

Remove a filter from the registry
public remove ( string $name ) : void
$name string The filter name to remove
return void

Property Details

$filters protected_oe property

The loaded filters.
protected array $filters
return array