alcea / cif
PHP validation for Romanian VAT code (Validare PHP pentru CIF | CUI)
Installs: 43 087
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.4.0
Requires (Dev)
- phpunit/phpunit: ^9
This package is auto-updated.
Last update: 2024-11-06 21:00:44 UTC
README
CIF
PHP validation for Romanian VAT code (Validare PHP pentru CIF/ CUI)
How to install?
1. use composer
composer require alcea/cif
2. or, edit require section from composer.json
"alcea/cif": "^1.1"
How to use?
<?php # require __DIR__ . '\vendor\autoload.php'; use alcea\cif\Cif; $cifToBeValidated = '159'; // without prefix digit (RO|R) $cif = new Cif($cifToBeValidated); echo "CIF {$cifToBeValidated} is " . ( $cif->isValid() ? 'valid' : 'invalid' ) . PHP_EOL; // or echo "CIF {$cifToBeValidated} is " . ( Cif::validate($cifToBeValidated) ? 'valid' : 'invalid' ) . PHP_EOL;
How to run tests?
## Open an terminal and run commands:
git clone https://github.com/alceanicu/cif.git
cd cif
composer install
./vendor/bin/phpunit --bootstrap ./vendor/autoload.php --testdox
License
This package is licensed under the MIT license.