SlotRule
in package
FinalYes
Declarative include/exclude rule for shaping the valid slot space.
Tags
Table of Contents
Properties
- $allow : bool
- $attributes : array<string, mixed>
- $pattern : string|array<string|int, mixed>|null
Methods
- __construct() : mixed
- The pattern can be a string or an array of dimension-value pairs.
- allow() : self
- Create an allow rule for the given pattern.
- deny() : self|RuleSet
- Create a deny rule for the given pattern.
- denyAll() : array<int, SlotRule>
- Create a list of allow rules for the given patterns.
- meta() : self
- Return a copy of the rule with additional metadata attributes.
Properties
$allow read-only
public
bool
$allow
$attributes read-only
public
array<string, mixed>
$attributes
= []
$pattern read-only
public
string|array<string|int, mixed>|null
$pattern
Methods
__construct()
The pattern can be a string or an array of dimension-value pairs.
public
__construct(bool $allow, array<string|int, non-empty-string|null>|non-empty-string|null $pattern[, array<string|int, mixed> $attributes = [] ]) : mixed
Parameters
- $allow : bool
- $pattern : array<string|int, non-empty-string|null>|non-empty-string|null
- $attributes : array<string|int, mixed> = []
Tags
allow()
Create an allow rule for the given pattern.
public
static allow(array<non-empty-string, non-empty-string|null>|non-empty-string $pattern[, array<string, mixed> $meta = [] ]) : self
The pattern can be a string or an array of dimension-value pairs.
Parameters
- $pattern : array<non-empty-string, non-empty-string|null>|non-empty-string
- $meta : array<string, mixed> = []
Tags
Return values
selfdeny()
Create a deny rule for the given pattern.
public
static deny(array<non-empty-string, non-empty-string|null>|non-empty-string $pattern, array<non-empty-string, non-empty-string|null>|non-empty-string ...$patterns) : self|RuleSet
The pattern can be a string or an array of dimension-value pairs.
Parameters
- $pattern : array<non-empty-string, non-empty-string|null>|non-empty-string
- $patterns : array<non-empty-string, non-empty-string|null>|non-empty-string
Tags
Return values
self|RuleSetdenyAll()
Create a list of allow rules for the given patterns.
public
static denyAll(array<int, string|array<int|string, non-empty-string|null>> $patterns) : array<int, SlotRule>
Parameters
- $patterns : array<int, string|array<int|string, non-empty-string|null>>
Tags
Return values
array<int, SlotRule>meta()
Return a copy of the rule with additional metadata attributes.
public
meta(array<string, mixed> $attributes) : self
Existing attributes keep precedence over newly provided ones.
Parameters
- $attributes : array<string, mixed>