2017 © Pedro PelĂĄez
 

library validator

Stuff validator

image

mrcnpdlk/validator

Stuff validator

  • Thursday, November 9, 2017
  • by mrcnpdlk
  • Repository
  • 0 Watchers
  • 0 Stars
  • 265 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Latest Stable Version Latest Unstable Version Total Downloads Monthly Downloads License, (*1)

Scrutinizer Code Quality Build Status Code Coverage, (*2)

Code Climate Issue Count, (*3)

Validator

Package include a lot of validators (mainly polish IDs), (*4)

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system., (*5)

Prerequisites

None, (*6)

Installing

Bst way:, (*7)

composer require mrcnpdlk/validator

Supported Types

Type Class Example
Date Date YYYY-MM-DD
DateTime DateTime YYYY-MM-DD HH:MM:SS
Polish identity card IdCard XXX12323
IP ver 4 address IPv4 192.168.1.1
MAC address Mac
Polish KRS Krs
Polish NIP Nip
Polish REGON Regon
Polish bank account Nrb
Polish PESEL Pesel
Polish postal code Pna
Polish phone Phone

Using

PESEL

$res = new \mrcnpdlk\Validator\Types\Pesel('12271402999');
var_dump($res->get()); //return parsed and cleaned string
var_dump($res->getBirthDate()); //return date in format YYY-MM-DD
var_dump($res->getAge()); //return int
var_dump($res->getSex()); //return F/M char

NIP

$res = new \mrcnpdlk\Validator\Types\Nip('362-005-44-28');
var_dump($res->get()); //return parsed and cleaned string (3620054428)
var_dump($res->getTaxOffice()); //return Tax Office name (Urząd Skarbowy PoznaƄ-Nowe Miasto)

REGON

$res = new \mrcnpdlk\Validator\Types\Regon('331501');
var_dump($res->get()); //return parsed and cleaned string (000331501)
var_dump($res->getShort()); //return short number (000331501)
var_dump($res->getLong()); //return long number (00033150100000)

NRB


$oNrb = new \mrcnpdlk\Validator\Types\Nrb('13 1020 2791 2123 5389 7801 0731'); var_dump($oNrb->get()); var_dump($oNrb->getBank()); var_dump($oNrb->getBankDepartment());

returns:, (*8)

string(26) "13102027912123538978010731"
string(3) "102"
string(8) "10202791"

PHONE

$oPhone = new \mrcnpdlk\Validator\Types\Phone('48 42 6742222');
var_dump($oPhone->isMobile());
var_dump($oPhone->isFixed());
var_dump($oPhone->isPremiumRate());
var_dump($oPhone->isTollFree());
var_dump($oPhone->isSharedCost());
var_dump($oPhone->isUAN());
var_dump($oPhone->isVoip());
var_dump($oPhone->getInternationalFormat());
var_dump($oPhone->getNationalFormat());
var_dump($oPhone->getRegion());

returns:, (*9)

bool(false)
bool(true)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)
string(11) "48426742222"
string(9) "426742222"
string(7) "ƁódĆș"

Running the tests

./vendor/bin/phpunit

Authors

  • Marcin PudeƂek - Initial work - mrcnpdlk

See also the list of contributors who participated in this project., (*10)

License

This project is licensed under the MIT License - see the LICENSE file for details, (*11)

The Versions

09/11 2017

dev-master

9999999-dev

Stuff validator

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

validator mac pesel regon nip krs

09/11 2017

v0.3.2

0.3.2.0

Stuff validator

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

validator mac pesel regon nip krs

09/11 2017

dev-devel

dev-devel

Stuff validator

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

validator mac pesel regon nip krs

06/10 2017

v0.3.1

0.3.1.0

Stuff validator

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

validator mac pesel regon nip krs

02/10 2017

v0.3.0

0.3.0.0

Stuff validator

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

validator mac pesel regon nip krs

18/09 2017

v0.2.0

0.2.0.0

Stuff validator

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

validator pesel regon nip krs

17/09 2017

v0.1.1

0.1.1.0

Stuff validator

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

validator pesel regon nip krs

15/09 2017

v0.1.0

0.1.0.0

Stuff validator

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

validator pesel regon nip krs