arteksoft / helper-validator
This Package provides various tools to normalize and validate data and variables for PHP-projects
0.0.6
2023-10-30 06:53 UTC
Requires
- php: ^8.2
- ext-ctype: *
- ext-iconv: *
- symfony/http-foundation: ^6.3
- thecodingmachine/safe: ^2.3
- webmozart/assert: ^1.11
Requires (Dev)
- doctrine/coding-standard: ^10.0
- phpunit/phpunit: ^9
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: ^3.7
- thecodingmachine/phpstan-strict-rules: ^1.0
README
This bundle provides various tools and shortcuts to validate and normalize incoming values from an API (and other validations you might need in different places).
Validators
Validators are static functions that can be used in various situations where it is necessary to validate if an incoming data is valid or not. For example, to validate that an incoming data is an INT and not something else.
The validators will return a BOOLEAN value depending on whether the input data is valid or not.
It is also possible to add the hardException = true
flag to throw an InvalidArgumentException
exception.