lessname / validator
Installs: 8 384
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.4.0
- ext-json: *
- lessname/documentor: ^0.4.0
Requires (Dev)
- ext-intl: *
- phpstan/phpstan: ^2.0.0
- phpunit/phpunit: ^10.0.0
- squizlabs/php_codesniffer: ^3.6.0
README
Validator your input
License
Mozilla Public License 2.0
Example
Validate input to be string
<?php
use LessValidator\Type\String\StringValidator;
$validator = new StringValidator();
$validator->validate('Foo')->isValid(); // true
$validator->validate(12345)->isValid(); // false
$validator->validate(12.34)->isValid(); // false
Key features
strongly typed, the library is strongly typed in two ways. First is that the code is strongly typed. Secondly the input is validated on type.
api based, the result of the validation can easily be used in an API.