V5.0.0
[A]
Added Processor for processing data before or after validation.[A]
Added or rule to allow any one of multiple rules to pass.[A]
Added support for passing ValidateScene directly to validation scenes.[A]
The only method of the validation scene class now supports reading all rules.[A]
The validator adds the exceptions attribute to specify the class of exceptions to be thrown upon validation failure.[U]
Adjusted the minimum PHP version requirement to 8.1.[D]
Deleted thedefault
method of the validation scene class, which can be replaced with the preprocessor method.[D]
Deleted thefilter
method of the validation scene class, which can be replaced with the postprocessor method.[D]
Deleted the rule manager, and some of its methods have been merged into the validator.[D]
Deleted the global extension rule method of the validator. To extend global rules, define a rule class to use. In the validator, theextend
,extendImplicit
,extendDependent
, andextendReplacer
methods are still available.
About Processor
Since the uses of default
and filters
are too diverse, the terms default
and filters
cannot accurately describe their uses. Therefore, they have been renamed to Processor, with default values
renamed to preprocessors
, and filters
renamed to postprocessors
. To define a processor class, you need to implement the Itwmw\Validate\Support\Concerns\ProcessorInterface
interface. Multiple processors can be used for a field. Multiple processors can be used for a field.