2017 © Pedro PelĂĄez
 

library vat-number-validator

PHP library to validate VAT numbers

image

antalaron/vat-number-validator

PHP library to validate VAT numbers

  • Friday, July 20, 2018
  • by antalaron
  • Repository
  • 1 Watchers
  • 3 Stars
  • 467 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 104 % Grown

The README.md

VAT number validator

Build Status Coverage Status Latest Stable Version Latest Unstable Version License, (*1)

PHP library to validate VAT numbers., (*2)

Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of this library:, (*3)

$ composer require antalaron/vat-number-validator

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation., (*4)

Basic usage

To validate a VAT number:, (*5)

use Antalaron\Component\VatNumberValidator\VatNumber;
use Symfony\Component\Validator\Validation;

$validator = Validation::createValidator();
$violations = $validator->validate('ATU37675002', new VatNumber());

if (0 !== count($violations)) {
    foreach ($violations as $violation) {
        echo $violation->getMessage().'<br>';
    }
}

You can add your own VAT validator via extraVat option:, (*6)

$violations = $validator->validate('11', new VatNumber(['extraVat' => function ($number) {
    return 0 !== preg_match('/^(\d{2})$/', $number);
}]));

Origin

This library is the PHP rewrite of original JavaScript library by Braemoor Software Freebies. Original contributors are found here., (*7)

License

This library is under MIT License., (*8)

The Versions

20/07 2018

dev-master

9999999-dev

PHP library to validate VAT numbers

  Sources   Download

MIT

The Requires

 

The Development Requires

20/07 2018

v1.1.1

1.1.1.0

PHP library to validate VAT numbers

  Sources   Download

MIT

The Requires

 

The Development Requires

12/02 2018

v1.1.0

1.1.0.0

PHP library to validate VAT numbers

  Sources   Download

MIT

The Requires

 

The Development Requires

14/07 2017

v1.0.2

1.0.2.0

PHP library to validate VAT numbers

  Sources   Download

MIT

The Requires

 

The Development Requires

17/04 2017

v1.0.1

1.0.1.0

PHP library to validate VAT numbers

  Sources   Download

MIT

The Requires

 

The Development Requires

14/04 2017

v1.0.0

1.0.0.0

PHP library to validate VAT numbers

  Sources   Download

MIT

The Requires

 

The Development Requires