You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All the validation constraint attributes have a double signature inherited from Doctrine annotation. You can pass options as an array as first argument or as named arguments.
Description
All the validation constraint attributes have a double signature inherited from Doctrine annotation. You can pass options as an array as first argument or as named arguments.
We promote using named arguments like this:
The same contraint definition with an array of options should be deprecated.
This will provide better type definition, especially for required arguments.
@param
doc will become more clear in [Validator] Add PHPDoc to validator constraints #52012.#[HasNamedArguments]
attribute introduced in [Validator] Allow creating constraints with required arguments #45072 will no longer be necessary since all constraint attribute would have named arguments.symfony/src/Symfony/Component/Validator/Constraints/Count.php
Lines 64 to 68 in dc23c8e
If developers need to create a constraint attribute from an array, they can use array unpacking.
Example
No response
The text was updated successfully, but these errors were encountered: