AttributeFilter
Matcher runs per source, OR-combined, then the exclude polarity is applied once.
Methods
- __construct() : mixed
- dropFunction() : callable(Attributes...): bool
- The compiled drop decision: true when a signal carrying the given per-source attributes should be dropped. Pass one {@see Attributes} per configured source (see {@see self::sources()}); the matcher is OR-combined across them. Processors hold this closure and call it directly to skip the {@see self::shouldDrop()} method-call layer on the hot path.
- shouldDrop() : bool
- True when a signal carrying these per-source attributes should be dropped.
- sources() : array<int, AttributeSource>
Methods
__construct()
public
__construct(Matcher $matcher[, bool $exclude = true ][, array<int, AttributeSource> $sources = [AttributeSource::SIGNAL] ][, null|string $cacheDir = null ][, int $cacheDirPermissions = 0700 ]) : mixed
Parameters
- $matcher : Matcher
- $exclude : bool = true
-
when true (default) a match drops the signal; when false only matching signals are kept
- $sources : array<int, AttributeSource> = [AttributeSource::SIGNAL]
-
attribute sets to inspect; the matcher is OR-combined across them (defaults to the signal's own attributes)
- $cacheDir : null|string = null
-
directory for the generated matcher file (defaults to the system temp directory). It is
required, so it MUST be trusted - not writable by untrusted users. Prefer an application-private directory over the shared system temp in multi-tenant environments. - $cacheDirPermissions : int = 0700
-
mode applied when the cache directory is created (octal, subject to umask; defaults to 0700 - owner only, since the directory holds
required PHP)
dropFunction()
The compiled drop decision: true when a signal carrying the given per-source attributes should be dropped. Pass one {@see Attributes} per configured source (see {@see self::sources()}); the matcher is OR-combined across them. Processors hold this closure and call it directly to skip the {@see self::shouldDrop()} method-call layer on the hot path.
public
dropFunction() : callable(Attributes...): bool
Return values
callable(Attributes...): boolshouldDrop()
True when a signal carrying these per-source attributes should be dropped.
public
shouldDrop(Attributes ...$perSource) : bool
Pass one Attributes per configured source (see self::sources()).
Parameters
- $perSource : Attributes
Return values
boolsources()
public
sources() : array<int, AttributeSource>