AnyRuleFromSet
extends RulesSet
in package
This rule tries to apply subrules in any order it can
Tags
Table of Contents
- $rules : array<string|int, RuleInterface>
- List of rules
- __construct() : mixed
- Constructor
- addRule() : void
- Method adds rule
- validate() : StringIterator
- {@inheritdoc}
- getRules() : array<string|int, RuleInterface>
- Method returns the list of rules
Properties
$rules
List of rules
private
array<string|int, RuleInterface>
$rules
= []
Methods
__construct()
Constructor
public
__construct(RuleInterface ...$rules) : mixed
Parameters
- $rules : RuleInterface
Return values
mixed —addRule()
Method adds rule
public
addRule(RuleInterface $rule) : void
Parameters
- $rule : RuleInterface
-
rule to be added
Return values
void —validate()
{@inheritdoc}
public
validate(StringIterator $iterator, bool &$ruleWasApplied) : StringIterator
Parameters
- $iterator : StringIterator
- $ruleWasApplied : bool
Tags
Return values
StringIterator —getRules()
Method returns the list of rules
protected
getRules() : array<string|int, RuleInterface>
Return values
array<string|int, RuleInterface> —list of rules