avkluchko/government-bundle

Utilities for use with Russian government classifiers and dictionaries

Installs: 163

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 1

Open Issues: 0

Type:symfony-bundle

v1.1.4 2022-03-13 12:45 UTC

This package is auto-updated.

Last update: 2024-05-13 17:37:22 UTC


README

Build Status Total Downloads Latest Stable Version License

Utilities for use with official Russians classifiers and dictionaries.

Requirements

The minumum requirement by Government Bundle is that your web-server supports PHP 7.4 or above.

Warning! If your server use PHP x32, than will work only simple validation without check control sum.

Installation

Install the package with:

composer require avkluchko/government-bundle

If you're not using Symfony Flex, you'll also need to enable the AVKluchko\GovernmentBundle\GovernmentBundle in your AppKernel.php file

Usage

OGRN Validator - validate Primary State Registration Number (OGRN).

// src/Controller/SomeController.php
use AVKluchko\GovernmentBundle\Validator\OGRNValidator;

// ...
class SomeController
{
    public function index(OGRNValidator $validator)
    {
        $isValid = $validator->isValid('some_ogrn');
        // ...
    }
}

INN Validator - validate Taxpayer Identification Number (INN).

// src/Controller/SomeController.php
use AVKluchko\GovernmentBundle\Validator\INNValidator;

// ...
class SomeController
{
    public function index(INNValidator $validator)
    {
        $isValid = $validator->isValid('some_inn');
        // ...
    }
}

SNILS Validator - validate Individual insurance account number (SNILS).

// src/Controller/SomeController.php
use AVKluchko\GovernmentBundle\Validator\SNILSValidator;

// ...
class SomeController
{
    public function index(SNILSValidator $validator)
    {
        $isValid = $validator->isValid('some_snils');
        // ...
    }
}