Description
This is a more concrete follow up RFC for #28611 + #31528 (https://symfony.com/blog/new-in-symfony-4-4-misc-improvements-part-1#consider-empty-strings-not-valid)
Im still having the "empty string is valid" issue, more or less unexpected for constraints Country and Email, and probably any other "string value validator".
Im pretty much convinced the "emptry string is valid" is an edge case, compared to the common case "an emptry string is not a valid email".
Also, i'd expect to safely pass e.g. ISO codes around with NotNull + Country
, not NotBlank + Country
.
Solving this issue allows to reduce such constraint lists to simply Country
with PHP 74, moving the type responsibility to the code level: public (?)string $country
.
I propose to KISS and deprecate empty strings per case.