wilsenhc/rif-validation

A Validation class to check if a RIF is valid

v1.0.0 2025-04-25 00:29 UTC

This package is auto-updated.

Last update: 2025-04-25 00:52:32 UTC


README

A Validation class to check if a RIF is valid

Latest Version on Packagist Tests Total Downloads

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.