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

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.