Repository navigation
phly/phly-rule-validation 0.2.0
Added
-
Adds support for PHP 8.3.
-
Adds
ValidationResultinterface, defining the key, value, validity, and error messages for a validation result. -
Adds
RuleSetValidatorinterface, defining how to validate a rule set, create a default initial valid result set based on the rule set, and retrieve individual rules from the rule set. -
Adds the
Phly\RuleValidation\RuleSet\Optionsinterface. -
Adds the
Phly\RuleValidation\RuleSet\RuleSetOptionsimplementation. -
Adds the
Phly\RuleValidation\Result\NestedResultclass, defining a result that has aResultSetas a value.
Changed
- The
Ruleinterface:- adds:
- a
missing(): ValidationResultmethod.
- a
- modifies:
default(); it now returns aValidationResultinstance.key(); it now expects anon-empty-string.validate(); it now returns aValidationResultinstance, and requires$contextto havenon-empty-stringkeys.
- adds:
- Renames
BooleanRuletoPhly\RuleValidation\Rule\BooleanRule, and updates it to the newRulerequirements. - Renames
CallbackRuletoPhly\RuleValidation\Rule\CallbackRule, and updates it to the newRulerequirements. - The
RuleSetclass:- Renames
RuleSettoPhly\RuleValidation\RuleSet\RuleSet. - Now implements
RuleSetValidator. - Is now idempotent; there is no
addRule()method. - The only ways to create an instance are now
__construct(Options $options)andcreateWithRules(Rule ...$rules). - It is no longer iterable.
getRuleForKey()is renamed togetRule().- It adds
__isset()and__get()implementations for access to named rules.
- Renames
- The
ResultSetclass:- Now implements
Countable. - Is now idempotent; there is no
add()method. All results must be provided to the constructor. - All methods are now marked
final. Extension only allows providing property type hints for the purpose of providing hints for composed validation results.
- Now implements