ee5d7fdacf
This PR was squashed before being merged into the 3.4 branch (closes #30737).
Discussion
----------
[Validator] Improve constraint default option check
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Any constraint without default option used as annotation with unnamed first argument (for example, `@Assert\Collection(1)`) throws an exception with an ugly message `The options "" do not exist in constraint Collection`.
This PR makes constraint check the default option in the annotation case in the same way it checks it in the "real" code case. So the exception will be `No default option is configured for constraint Collection.`
Commits
-------
|
||
---|---|---|
.. | ||
Constraints | ||
Context | ||
DataCollector | ||
DependencyInjection | ||
Exception | ||
Mapping | ||
Resources/translations | ||
Test | ||
Tests | ||
Util | ||
Validator | ||
Violation | ||
.gitignore | ||
CHANGELOG.md | ||
composer.json | ||
Constraint.php | ||
ConstraintValidator.php | ||
ConstraintValidatorFactory.php | ||
ConstraintValidatorFactoryInterface.php | ||
ConstraintValidatorInterface.php | ||
ConstraintViolation.php | ||
ConstraintViolationInterface.php | ||
ConstraintViolationList.php | ||
ConstraintViolationListInterface.php | ||
ContainerConstraintValidatorFactory.php | ||
GroupSequenceProviderInterface.php | ||
LICENSE | ||
ObjectInitializerInterface.php | ||
phpunit.xml.dist | ||
README.md | ||
Validation.php | ||
ValidatorBuilder.php | ||
ValidatorBuilderInterface.php |
Validator Component
The Validator component provides tools to validate values following the JSR-303 Bean Validation specification.