lessname / validator
This package is abandoned and no longer maintained.
No replacement package was suggested.
Validate your input
3.1.0
2020-09-18 16:56 UTC
Requires
- php: ^7.4.0
- ext-json: *
Requires (Dev)
- ext-mbstring: *
- lessname/lint: ^2.0.0
- lessname/test: ^2.0.0
Suggests
- ext-mbstring: Required for some string validators so utf8 is supported
This package is auto-updated.
Last update: 2021-11-27 14:07:32 UTC
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.