2017 © Pedro Peláez
 

library nif-validator

Yet another(?) PHP implementation of the spanish NIF validator

image

ulabox/nif-validator

Yet another(?) PHP implementation of the spanish NIF validator

  • Wednesday, August 2, 2017
  • by ulabox
  • Repository
  • 3 Watchers
  • 18 Stars
  • 9,493 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 5 Versions
  • 25 % Grown

The README.md

nif-validator

Build Status, (*1)

A modern PHP 7.0+ Spanish NIF (Número de Indentifación Fiscal) validator., (*2)

Why another NIF validator?

Other NIF validators we saw either had really obscure code or just implemented a validator for the DNI/NIE, not the CIF., (*3)

Installation

Using Composer:, (*4)

composer require ulabox/nif-validator

Usage

<?php

use NifValidator\NifValidator;

//CIF
assert(NifValidator::isValid('B65410011'));
//DNI
assert(NifValidator::isValid('93471790C'));
//NIE
assert(NifValidator::isValid('X5102754C'));

Starting from version 1.1.x you can also separetely validate personal and entity nifs, (*5)

<?php

use NifValidator\NifValidator;

//CIF
assert(NifValidator::isValidEntity('B65410011'));
//DNI
assert(NifValidator::isValidPersonal('93471790C'));
//NIE
assert(NifValidator::isValidPersonal('X5102754C'));

Starting from version 1.2.x you can also separetely validate individual nif types, (*6)

```php <?php, (*7)

use NifValidator\NifValidator;, (*8)

//CIF assert(NifValidator::isValidCif('B65410011')); //DNI assert(NifValidator::isValidDni('93471790C')); //NIE assert(NifValidator::isValidNie('X5102754C'));, (*9)

This validator does not strip or uppercase any character, it's your responsibility to previously filter the input., (*10)

The Versions

02/08 2017

dev-master

9999999-dev https://github.com/ulabox/nif-validator

Yet another(?) PHP implementation of the spanish NIF validator

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

by Albert Casademont

validator nif

02/08 2017

v1.2.0

1.2.0.0 https://github.com/ulabox/nif-validator

Yet another(?) PHP implementation of the spanish NIF validator

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

by Albert Casademont

validator nif

28/07 2017

v1.1.1

1.1.1.0 https://github.com/ulabox/nif-validator

Yet another(?) PHP implementation of the spanish NIF validator

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

by Albert Casademont

validator nif

26/07 2017

v1.1.0

1.1.0.0 https://github.com/ulabox/nif-validator

Yet another(?) PHP implementation of the spanish NIF validator

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

by Albert Casademont

validator nif

25/07 2017

v1.0.0

1.0.0.0 https://github.com/ulabox/nif-validator

Yet another(?) PHP implementation of the spanish NIF validator

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

by Albert Casademont

validator nif