maker-bundle
maker-bundle copied to clipboard
[RFC] make:entity : add regexp control for field
Hello, I imagine a regexp associated for each field during the make:entity operation. This regexp would then apply to :
- a check constraint for field in database (via migration process)
- a check for back via a loadValidatorMetadata for Symfony Entity : Assert\Regex(['pattern' ...
- a check for front via a loadValidatorMetadata for Symfony Entity : Assert\Regex(['htmlPattern' ...
I think that could avoid a lot of security issues ... Would this feature interest people ?
In the same idea, why not add a NotBlank() PropertyConstraint in loadValidatorMetadata() for each nonnullable field ?