ajgl / validator-es
Validation library for some Spanish codes.
0.2.0
2026-09-14 12:48 UTC
Requires
- php: >=8.2
- symfony/polyfill-intl-icu: ^1.28
- thecodingmachine/safe: ^3.0
Requires (Dev)
- ergebnis/composer-normalize: ^2.52
- friendsofphp/php-cs-fixer: ^3.95.3
- matthiasnoback/symfony-dependency-injection-test: ^6.3
- phpstan/extension-installer: ^1.4.3
- phpstan/phpstan: ^2.2.1
- phpstan/phpstan-phpunit: ^2.0.16
- phpunit/phpunit: ^11.5.55
- rector/rector: ^2.4.5
- symfony/framework-bundle: ^6.4 || ^7.4 || ^8.0
- symfony/validator: ^6.4 || ^7.4 || ^8.0
- symfony/var-dumper: ^6.4 || ^7.4 || ^8.0
- thecodingmachine/phpstan-safe-rule: ^1.4.3
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
This library provides some validators for common Spanish codes.
Current supported codes to validate are:
Installation
composer require ajgl/validator-es
Usage
All validators implements a common interface with only one method:
<?php namespace Ajgl\ValidatorEs; interface ValidatorInterface { public function isValid(mixed $value): bool; }
To use any validator, you must instantiate it, and call the isValid method:
<?php require 'vendor/autoload.php'; $value = 'Y0000000Z'; $validator = new \Ajgl\ValidatorEs\IdCardValidator(); assert($validator->isValid($value));
License
This library is released under an open source license. See the complete license in the LICENSE file.
Reporting an issue or a feature request
Read the CONTRIBUTING.md file.
Author Information
Developed with ♥ by Antonio J. García Lagar.
If you find this library useful, please add a ★ in the GitHub repository page.