obsidian / validation
Validates input against string rulesets.
v0.1.0
2021-02-27 17:25 UTC
Requires
- php: ^7.1
- ext-ctype: *
- ext-fileinfo: *
- ext-json: *
- ext-mbstring: *
Requires (Dev)
- phpunit/phpunit: ^7
This package is auto-updated.
Last update: 2024-10-29 06:00:18 UTC
README
Validates input against string rulesets.
Installation
Installation is done entirely through composer.
composer require obsidian/validation
Example
use Obsidian\Validation\Validator; $validator = Validator::make( array( 'username' => 'string|required|min:5|max:75', 'email' => 'email' ) ); // does not fail var_dump($validator->validate(array( 'username' => 'github', 'email' => 'noreply@github.com' ))); // bool(true) // fails $validator->validate(array( 'username' => 5, 'email' => 'noreply@github.com' )); // throws InvalidArgumentException