Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
Closed
Description
seesymfony/symfony#27917 +symfony/symfony#12312
https://symfony.com/doc/current/validation/custom_constraint.html
instead of
if (!is_string($value)) {- throw new UnexpectedTypeException($value, 'string');+ throw new UnexpectedValueException($value, 'string');}This will cause a violation to be raised instead.
The"string" value is used withThis value should be of type {{ type }}., thus should be translator friendly. E.g. core uses phpdoc notation to avoid any grammar being used here (string|int instead ofstring or integer andSome&Other instead ofSome and Other).