impulsephp / validator
A lightweight and extensible validation engine for ImpulsePHP components. Provides form validation rules and unified syntax for server-side validation.
v1.0.0-beta
2025-08-03 09:33 UTC
Requires
- php: >=8.2
This package is auto-updated.
Last update: 2025-08-03 10:22:58 UTC
README
A lightweight and extensible validation engine for ImpulsePHP. The validator provides common validation rules and a unified API for server-side form validation.
Installation
Use Composer to add the package to your project:
composer require impulsephp/validator
If you are working from the source repository, run composer install
to generate the autoloader.
Quick start
use Impulse\Validator\Validator; $validator = new Validator(); $errors = $validator->validate('username', 'Bob', 'required|min_length:3'); if ($errors) { // Handle validation errors }
Documentation
More extensive documentation is available in the docs directory:
Testing
Unit tests are written with PHPUnit. From the project root run:
composer install vendor/bin/phpunit
A simple test configuration is included in phpunit.xml
.