maker-bundle icon indicating copy to clipboard operation
maker-bundle copied to clipboard

[RFC] make:entity : add regexp control for field

Open linuxprocess opened this issue 3 years ago • 1 comments

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 ?

linuxprocess avatar Jul 12 '22 08:07 linuxprocess

In the same idea, why not add a NotBlank() PropertyConstraint in loadValidatorMetadata() for each nonnullable field ?

linuxprocess avatar Jul 19 '22 07:07 linuxprocess