2017 © Pedro Peláez
 

library ogrn

Tiny library for validating OGRN and OGRNIP business identifiers in Russia.

image

ybelenko/ogrn

Tiny library for validating OGRN and OGRNIP business identifiers in Russia.

  • Thursday, June 1, 2017
  • by ybelenko
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

OGRN

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

Tiny PHP library for validating OGRN(ОГРН) and OGRNIP(ОГРНИП) business identifiers in Russia. It just verifies number length and last control digit, so if identifier passes validation it doesn't mean that it exists in a real world. If you need to check that OGRN or OGRNIP exists visit http://egrul.nalog.ru., (*2)

Installation

It's recommended that you use Composer to install., (*3)

$ composer require ybelenko/ogrn

Usage

require_once __DIR__ . '/vendor/autoload.php';

use Ybelenko\Ogrn\Ogrn;
use Ybelenko\Ogrn\Ogrnip;

// when you need to validate OGRN number
$isValid = Ogrn::validate("1127746509780");// returns true if identifier is valid

// when you need to validate OGRNIP number
$isValid = Ogrnip::validate("304500116000157");// returns true if identifier is valid

While 32 bit systems have a maximum signed integer range of -2147483648 to 2147483647 you always should store OGRN and OGRNIP identifiers as string., (*4)

$ogrn = 1127746509780; // is bad 
echo $ogrn; // 2147483647

$ogrn = '1127746509780'; // is good
echo $ogrn; // 1127746509780

Tests

To execute the test suite, you'll need to clone current repo and install it with dev dependencies:, (*5)

$ git clone https://github.com/ybelenko/ogrn
$ cd ogrn
$ composer install
$ composer test

The Versions

01/06 2017

dev-master

9999999-dev https://github.com/ybelenko/ogrn

Tiny library for validating OGRN and OGRNIP business identifiers in Russia.

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0
  • ext-gmp *

 

The Development Requires

by Yuriy Belenko

validation business identifiers ogrn ogrnip

26/05 2017

v1.0.0

1.0.0.0 https://github.com/ybelenko/ogrn

Tiny library for validating OGRN and OGRNIP business identifiers in Russia.

  Sources   Download

MIT

The Requires

  • php ^5.3.3 || ^7.0
  • ext-gmp *

 

The Development Requires

by Yuriy Belenko

validation business identifiers ogrn ogrnip