Closed dresslerdemos closed 3 months ago
phpixie/validate
: type awareness doesn't seem to be build in; no phpstan compatibility was found
beberlei/assert
: has a phpstan extension, but is (for performance reasons) kept very simple. Thus it is more an alternative to webmozart/assert
(which is already used with a phpstan extension) than to Symfony Validation.
zendframework/zend-validator
: is no longer maintained and recommends laminas/laminas-validator
laminas/laminas-validator
: an phpstan extension https://github.com/Slamdunk/phpstan-laminas-framework for the Laminas framework in general, but it does not support the wanted validation typing
Respect/Validation
: no phpstan extension was found
It is quite possible that no library exists that covers all requirements. Also, there is no major concern in keeping Symfony Validation:
Due to those considerations, the investigation is closed for now.
Currently Symfony Validation is used to validate request data, however, phpstan is not able to infer the type from that, which increases the chance for type based bugs in the code.
Something like https://github.com/jbboehr/phpstan-laravel-validation is needed, but with a license that allows usage inside a MIT (Expat) licensed project, which is not the case with AGPL v3+.