wilsenhc / rif-validation
A Validation class to check if a RIF is valid
Requires
- php: ^8.2
Requires (Dev)
- phpunit/phpunit: ^11.0 || ^12.0
README
A Validation class to check if a RIF is valid
This package provides a class to validate a RIF (Registro Único de Información Fiscal).
Overview
The rif-validation
library provides a simple and efficient way to validate RIF (Registro de Información Fiscal) numbers in PHP.
This library includes methods to check the validity of RIF numbers and retrieve error messages for invalid entries.
Installation
You can install the library using Composer. Run the following command in your terminal:
composer require wilsenhc/rif-validation
Usage
To use the Validation
class, include the autoloader and create an instance of the class:
require 'vendor/autoload.php'; use Wilsenhc\RifValidation\RifValidator; $validator = new RifValidator(); if ($validator->isValid('RIF_NUMBER')) { echo "The RIF number is valid."; } else { echo "The RIF number is NOT valid."; }
Methods
isValid($rif)
: Validates the provided RIF number.
Contributing
Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.
License
This project is licensed under the MIT License. See the LICENSE file for more details.