Major version of Yii Validator were tagged.
- Add the
Each::PARAMETER_EACH_KEYvalidation context parameter that available duringEachrule handling and containing the current key - Include attribute name in error messages when it's present
- Add PHP attribute that sets property label for usage in error messages
- Add
InEnumrule - Change "attribute" to "property" in class/trait/method/variable/placeholder names
- Change type of
$escapeargument inError::getValuePath()frombool|string|nulltostring|null - List translated attributes in error message for
OneOfandAtLeastrules - Fix meaning of error message in
OneOfrule - Improve meaning and use pluralization in error message for
OneOfandAtLeastrules - Disallow
$mingreater than amount of$attributesinAtLeastconfiguration - Move
getName()method fromRuleInterfacetoRuleWithOptionsInterface - Rename
RuleWithOptionsInterfacetoDumpedRuleInterface - Use FQCN as a name for built-in rules during export with
RulesDumper - Use FQCN as a name for rules not implementing
DumpedRuleInterfaceduring export withRulesDumper - Change type of
$skipOnEmptyargument in rules' constructors frommixedtobool|callable|null - Change type of
$ruleargument inRuleHandlerInterface::validate()fromobjecttoRuleInterface - Rename
AtLeastrule toFilledAtLeastandOneOfrule toFilledOnlyOneOf - Add type to error messages related with incorrect input
- Use
json_validate()built-in PHP function inJsonHandlerif code is run with PHP 8.3 - Improve psalm annotations in
Resultclass - Add German translation
- Simplify validation of JSON in
JsonHandlerusing built-in PHP functions for PHP versions below 8.3 - Raise the minimum version of PHP to 8.1
- Refactor
Result::add(): tookarray_merge()out of theforeach - Make parameter
$rulesinRulesNormalizer::normalize()optional - Make
Json::$messagea bit more clear - Fix property name usage in error messages of rules in
Nestedrule - Rules provided by data object PHP attributes were not used in
RulesNormalizer::normalize() - Fix wrong value for
typeparameter forEach::$incorrectInputKeyMessage
See upgrading instructions with notes about upgrading package in your application to this major version.