Yii Validator 2.0
2024-08-02
713次浏览
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 with RulesDumper - 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 for
Each::$incorrectInputKeyMessage
See upgrading instructions with notes about upgrading package in your application to this major version.
新闻归档
热门标签
- yii3
- 扩展
- 发布
- yii2
- debug
- view
- auth client
- bootstrap
- html
- release
- apidoc
- redis
- Yii 2.0
- mongodb
- Yii 1.1
- extensions
- mailer
- gii
- console
- runner
- http 客户端
- validation
- twig
- queue
- http
- translator
- cache
- hydrator
- widget
- sphinx
- error handler
- config
- db
- log
- assets
- symfonymailer
- router
- elasticsearch
- swagger
- swiftmailer
- 图书
- imagine
- definitions
- user
- IDE
- csrf
- i18n
- fastroute
- rbac
- logging