RuleSet
in package
FinalYes
Composable container for slot and edge rules.
Tags
Table of Contents
Properties
- $rules : array<string|int, mixed>
Methods
- __construct() : mixed
- all() : array<int, EdgeRule>|array<int, SlotRule>
- Recursively flatten the RuleSet and return all rules as a single array.
- from() : self
- meta() : self
- Apply $attribute metadata to all rules in the RuleSet.
Properties
$rules
public
array<string|int, mixed>
$rules
Methods
__construct()
public
__construct(array<string|int, SlotRule|EdgeRule|RuleSet> $rules) : mixed
Parameters
Tags
all()
Recursively flatten the RuleSet and return all rules as a single array.
public
all() : array<int, EdgeRule>|array<int, SlotRule>
Tags
Return values
array<int, EdgeRule>|array<int, SlotRule> —a flat list of all rules contained in the RuleSet, including those in nested RuleSets
from()
public
static from(SlotRule|EdgeRule|RuleSet ...$rules) : self
Parameters
Tags
Return values
selfmeta()
Apply $attribute metadata to all rules in the RuleSet.
public
meta(array<string, mixed> $attributes) : self
This method recursively applies the metadata to any nested RuleSets as well.
Parameters
- $attributes : array<string, mixed>
-
The metadata attributes to apply
Tags
Return values
self —A new RuleSet instance with the metadata applied to all contained rules