EnsureFilterWorker
in package
implements
WorkerInterface
Applies a filter to an asset based on a source and/or target path match.
Tags
Interfaces, Classes and Traits
- WorkerInterface
- Assets are passed through factory workers before leaving the factory.
Table of Contents
- CHECK_SOURCE = 1
- CHECK_TARGET = 2
- $filter : mixed
- $flags : mixed
- $pattern : mixed
- __construct() : mixed
- Constructor.
- process() : AssetInterface|null
- Processes an asset.
Constants
CHECK_SOURCE
public
mixed
CHECK_SOURCE
= 1
CHECK_TARGET
public
mixed
CHECK_TARGET
= 2
Properties
$filter
private
mixed
$filter
$flags
private
mixed
$flags
$pattern
private
mixed
$pattern
Methods
__construct()
Constructor.
public
__construct(string $pattern, FilterInterface $filter[, int $flags = null ]) : mixed
Parameters
- $pattern : string
-
A regex for checking the asset's target URL
- $filter : FilterInterface
-
A filter to apply if the regex matches
- $flags : int = null
-
Flags for what to check
Return values
mixed —process()
Processes an asset.
public
process(AssetInterface $asset, AssetFactory $factory) : AssetInterface|null
Parameters
- $asset : AssetInterface
-
An asset
- $factory : AssetFactory
-
The factory
Return values
AssetInterface|null —May optionally return a replacement asset