2017 © Pedro PelĂĄez
 

library polish-validator-bundle

Symfony bundle with validators for Polish identification numbers: PESEL, NIP, REGON, PWZ.

image

kiczort/polish-validator-bundle

Symfony bundle with validators for Polish identification numbers: PESEL, NIP, REGON, PWZ.

  • Tuesday, February 13, 2018
  • by kiczort
  • Repository
  • 3 Watchers
  • 4 Stars
  • 2,234 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 8 Versions
  • 21 % Grown

The README.md

Symfony bundle with Polish validators

License Version Build status Scrutinizer Quality Score FOSSA Status, (*1)

This is Symfony bundle with validators for Polish identification numbers like: PESEL, NIP, REGON and PWZ., (*2)

Installation

The recommended way to install this library is Composer., (*3)

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version:, (*4)

php composer.phar require kiczort/polish-validator-bundle

Add bundle to AppKernel.php, (*5)

    public function registerBundles()
        {
            $bundles = array(
                ...
                new Kiczort\PolishValidatorBundle\KiczortPolishValidatorBundle(),
                ...
            );

            return $bundles;
        }

Documentation

Example of use PeselValidator:

There are PESEL numbers with errors in real word, so in case of this validator checksum checking is only for strict mode. In case of none strict mode it checks length, used chars and correctness of date of birth., (*6)

...
// src/AppBundle/Entity/Person.php
namespace AppBundle\Entity;

use Kiczort\PolishValidatorBundle\Validator\Constraints  as KiczortAssert;

class Person
{
    /**
     * @KiczortAssert\Pesel(
     *     message = "The '{{ value }}' is not a valid PESEL number.",
     *     strict = true
     * )
     */
     #[KiczortAssert\Pesel(message:  "The '{{ value }}' is not a valid PESEL number.", strict: true)]
     protected $pesel;
}

Example of use NipValidator:

...
// src/AppBundle/Entity/Person.php
namespace AppBundle\Entity;

use Kiczort\PolishValidatorBundle\Validator\Constraints as KiczortAssert;

class Person
{
    /**
     * @KiczortAssert\Nip
     */
     #[KiczortAssert\Nip(message:  "This is not a valid NIP number.")]
     protected $nip;
}

Example of use RegonValidator:

...
// src/AppBundle/Entity/Company.php
namespace AppBundle\Entity;

use Kiczort\PolishValidatorBundle\Validator\Constraints as KiczortAssert;

class Company
{
    /**
     * @KiczortAssert\Regon
     */
     #[KiczortAssert\Regon(message:  "This is not a valid REGON number.")]
     protected $regon;
}

Example of use PwzValidator:

PWZ means "licence to practise a profession" (pl. "prawo wykonywania zawodu"), number given to doctors from NIL (polish Chamber of Physicians and Dentists). Validator accepts also empty strings and nulls so you have to add "Assert/NotBlank" myself., (*7)

...
// src/AppBundle/Entity/Company.php
namespace AppBundle\Entity;

use Kiczort\PolishValidatorBundle\Validator\Constraints  as KiczortAssert;

class Doctor
{
    /**
     * @KiczortAssert\Pwz
     */
     #[KiczortAssert\Pwz(message:  "This is not a valid PWZ number.")]
     protected $pwz;
}

Bug tracking

GitHub issues. If you have found bug, please create an issue., (*8)

MIT License

License can be found here., (*9)

FOSSA Status, (*10)

The Versions

13/02 2018

dev-master

9999999-dev

Symfony bundle with validators for Polish identification numbers: PESEL, NIP, REGON, PWZ.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Grzegorz KoziƄski

validator symfony bundle pesel regon nip polish validator pl validator symfony validator pwz

13/02 2018

dev-feature/support-for-sf4

dev-feature/support-for-sf4

Symfony bundle with validators for Polish identification numbers: PESEL, NIP, REGON, PWZ.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Grzegorz KoziƄski

validator symfony bundle pesel regon nip polish validator pl validator symfony validator pwz

03/05 2017

1.1.1

1.1.1.0

Symfony bundle with validators for Polish identification numbers: PESEL, NIP, REGON.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Grzegorz KoziƄski

validator symfony bundle pesel regon nip polish validator pl validator symfony validator pwz

27/02 2017

v1.1.0

1.1.0.0

Symfony bundle with validators for Polish identification numbers: PESEL, NIP, REGON.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Grzegorz KoziƄski

validator symfony bundle pesel regon nip polish validator pl validator symfony validator pwz

22/07 2016

v1.0.1

1.0.1.0

Symfony2 bundle with validators for Polish identification numbers: PESEL, NIP, REGON.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Grzegorz KoziƄski

validator symfony bundle pesel regon nip polish validator pl validator symfony validator

19/07 2016

dev-scrutinizer-patch-2

dev-scrutinizer-patch-2

Symfony2 bundle with validators for Polish identification numbers: PESEL, NIP, REGON.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Grzegorz KoziƄski

validator symfony bundle pesel regon nip polish validator pl validator symfony validator

19/07 2016

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1

Symfony2 bundle with validators for Polish identification numbers: PESEL, NIP, REGON.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Grzegorz KoziƄski

validator symfony bundle pesel regon nip polish validator pl validator symfony validator

19/07 2016

v1.0.0

1.0.0.0

Symfony2 bundle with validators for Polish identification numbers: PESEL, NIP, REGON.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Grzegorz KoziƄski

validator symfony bundle pesel regon nip polish validator pl validator symfony validator