phpyh / validator
Mother's friend's son's validator
dev-master / 0.1.x-dev
2020-10-02 01:40 UTC
Requires
- php: ^7.4 || 8.*
- psr/container: ^1.0
- symfony/polyfill-php80: ^1.18
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- icanhazstring/composer-unused: ^0.7.4
- maglnet/composer-require-checker: ^2.1
- phpunit/phpunit: ^9.3
- psalm/plugin-phpunit: ^0.12.2
- vimeo/psalm: ^3.16
This package is auto-updated.
Last update: 2024-10-29 06:05:57 UTC
README
«Валидатор сына маминой подруги», — Роман Пронский.
namespace PHPyh\Validator; $validator = new Validator( new RuleHandlerRegistry\InMemoryRuleHandlerRegistry([ new Rule\AllHandler(), new Rule\AnyHandler(), new Rule\ObjectPropertiesHandler(), new Rule\GreaterThanHandler(), ]) ); final class SomeDto { public int $age = 10; public int $height = 130; } $errors = $validator->validate( new SomeDto(), new Rule\Any([ new Rule\ObjectProperties([ 'age' => new Rule\GreaterThan(18), 'height' => new Rule\GreaterThan(150), ]) ]) );