Added
-
Adds support for PHP 8.3.
-
Adds
ValidationResult
interface, defining the key, value, validity, and error messages for a validation result. -
Adds
RuleSetValidator
interface, 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\Options
interface. -
Adds the
Phly\RuleValidation\RuleSet\RuleSetOptions
implementation. -
Adds the
Phly\RuleValidation\Result\NestedResult
class, defining a result that has aResultSet
as a value.
Changed
- The
Rule
interface:- adds:
- a
missing(): ValidationResult
method.
- a
- modifies:
default()
; it now returns aValidationResult
instance.key()
; it now expects anon-empty-string
.validate()
; it now returns aValidationResult
instance, and requires$context
to havenon-empty-string
keys.
- adds:
- Renames
BooleanRule
toPhly\RuleValidation\Rule\BooleanRule
, and updates it to the newRule
requirements. - Renames
CallbackRule
toPhly\RuleValidation\Rule\CallbackRule
, and updates it to the newRule
requirements. - The
RuleSet
class:- Renames
RuleSet
toPhly\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
ResultSet
class:- 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