Major version of Yii Validator were tagged.
- Add the
Each::PARAMETER_EACH_KEY
validation context parameter that available duringEach
rule 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
InEnum
rule - Change "attribute" to "property" in class/trait/method/variable/placeholder names
- Change type of
$escape
argument inError::getValuePath()
frombool|string|null
tostring|null
- List translated attributes in error message for
OneOf
andAtLeast
rules - Fix meaning of error message in
OneOf
rule - Improve meaning and use pluralization in error message for
OneOf
andAtLeast
rules - Disallow
$min
greater than amount of$attributes
inAtLeast
configuration - Move
getName()
method fromRuleInterface
toRuleWithOptionsInterface
- Rename
RuleWithOptionsInterface
toDumpedRuleInterface
- Use FQCN as a name for built-in rules during export with
RulesDumper
- Use FQCN as a name for rules not implementing
DumpedRuleInterface
during export withRulesDumper
- Change type of
$skipOnEmpty
argument in rules' constructors frommixed
tobool|callable|null
- Change type of
$rule
argument inRuleHandlerInterface::validate()
fromobject
toRuleInterface
- Rename
AtLeast
rule toFilledAtLeast
andOneOf
rule toFilledOnlyOneOf
- Add type to error messages related with incorrect input
- Use
json_validate()
built-in PHP function inJsonHandler
if code is run with PHP 8.3 - Improve psalm annotations in
Result
class - Add German translation
- Simplify validation of JSON in
JsonHandler
using 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
$rules
inRulesNormalizer::normalize()
optional - Make
Json::$message
a bit more clear - Fix property name usage in error messages of rules in
Nested
rule - Rules provided by data object PHP attributes were not used in
RulesNormalizer::normalize()
- Fix wrong value for
type
parameter forEach::$incorrectInputKeyMessage
See upgrading instructions with notes about upgrading package in your application to this major version.