PHPackages                             mrcnpdlk/validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. mrcnpdlk/validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

mrcnpdlk/validator
==================

Stuff validator

v0.3.2(8y ago)012.7k↓46%MITPHPPHP &gt;=7.0

Since Sep 15Pushed 8y agoCompare

[ Source](https://github.com/mrcnpdlk/validator)[ Packagist](https://packagist.org/packages/mrcnpdlk/validator)[ RSS](/packages/mrcnpdlk-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (8)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/20c0be8e2da006c815676206541c633a2cf76914f80e84b9c25d09acff5e37c6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6d72636e70646c6b2f76616c696461746f722e737667)](https://packagist.org/packages/mrcnpdlk/validator)[![Latest Unstable Version](https://camo.githubusercontent.com/bfaa8711e597f62707a3039b7c07ab973c10a7d539fb8488096c98f43088fc91/68747470733a2f2f706f7365722e707567782e6f72672f6d72636e70646c6b2f76616c696461746f722f762f756e737461626c652e706e67)](https://packagist.org/packages/mrcnpdlk/validator)[![Total Downloads](https://camo.githubusercontent.com/b10a421a650aa24ac253310cd4498a84532b5281d818fdc4dd81b7cd48cf5853/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d72636e70646c6b2f76616c696461746f722e737667)](https://packagist.org/packages/mrcnpdlk/validator)[![Monthly Downloads](https://camo.githubusercontent.com/9afc8b83dd8966f690a52f9b56044710995b9d795e1f2680ecd66135e0b8b674/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6d72636e70646c6b2f76616c696461746f722e737667)](https://packagist.org/packages/mrcnpdlk/validator)[![License](https://camo.githubusercontent.com/f85ad813bc64892dc037088be6be4f3d25ffbe7799f9309aa628c3f4d9a40fcb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d72636e70646c6b2f76616c696461746f722e737667)](https://packagist.org/packages/mrcnpdlk/validator)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ceab3fad12856febe5e61349a940070a9a52b6457ccb2bb61954a45d25073eb4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d72636e70646c6b2f76616c696461746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mrcnpdlk/validator/?branch=master)[![Build Status](https://camo.githubusercontent.com/613116092dfd6cb1c63b7984e75aa661eed3cfbcca4a3a51e0763d65a798331b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d72636e70646c6b2f76616c696461746f722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mrcnpdlk/validator/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/c3fc814f64936763dad584e01a9977cfa3ea321156e5566f94abe446338e19e3/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d72636e70646c6b2f76616c696461746f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mrcnpdlk/validator/?branch=master)

[![Code Climate](https://camo.githubusercontent.com/e4704171f0c818ab8e08de0d1c0b15cedeaf6eaf9ef2f10f153e5b0c1b54ecf0/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d72636e70646c6b2f76616c696461746f722f6261646765732f6770612e737667)](https://codeclimate.com/github/mrcnpdlk/validator)[![Issue Count](https://camo.githubusercontent.com/ac2e8b4efdff3ecf144894aeb4571d36b22715460773c8532eb20a79a3f6a483/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d72636e70646c6b2f76616c696461746f722f6261646765732f69737375655f636f756e742e737667)](https://codeclimate.com/github/mrcnpdlk/validator)

Validator
=========

[](#validator)

Package include a lot of validators (mainly polish IDs)

Getting Started
---------------

[](#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.

### Prerequisites

[](#prerequisites)

None

### Installing

[](#installing)

Bst way:

```
composer require mrcnpdlk/validator
```

### Supported Types

[](#supported-types)

TypeClassExampleDateDateYYYY-MM-DDDateTimeDateTimeYYYY-MM-DD HH:MM:SSPolish identity cardIdCardXXX12323IP ver 4 addressIPv4192.168.1.1MAC addressMacPolish KRSKrsPolish NIPNipPolish REGONRegonPolish bank accountNrbPolish PESELPeselPolish postal codePnaPolish phonePhone### Using

[](#using)

#### PESEL

[](#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

[](#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

[](#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

[](#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:

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

```

#### PHONE

[](#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:

```
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
-----------------

[](#running-the-tests)

```
./vendor/bin/phpunit
```

Authors
-------

[](#authors)

- **Marcin Pudełek** - *Initial work* - [mrcnpdlk](https://github.com/mrcnpdlk)

See also the list of [contributors](https://github.com/mrcnpdlk/validator/graphs/contributors) who participated in this project.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](https://github.com/mrcnpdlk/validator/blob/master/LICENSE) file for details

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~10 days

Total

6

Last Release

3112d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e9b157a438a90ac875df96b1b332262157576dad35ab4a49ab7837dd1ed4bd2b?d=identicon)[mrcnpdlk](/maintainers/mrcnpdlk)

---

Top Contributors

[![mrcnpdlk](https://avatars.githubusercontent.com/u/22945316?v=4)](https://github.com/mrcnpdlk "mrcnpdlk (46 commits)")

---

Tags

validatorMACregonnipkrspesel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mrcnpdlk-validator/health.svg)

```
[![Health](https://phpackages.com/badges/mrcnpdlk-validator/health.svg)](https://phpackages.com/packages/mrcnpdlk-validator)
```

###  Alternatives

[respect/validation

The most awesome validation engine ever created for PHP

5.9k37.4M383](/packages/respect-validation)[seld/jsonlint

JSON Linter

1.3k217.8M205](/packages/seld-jsonlint)[composer/spdx-licenses

SPDX licenses list and validation library.

1.4k184.2M25](/packages/composer-spdx-licenses)[opis/json-schema

Json Schema Validator for PHP

64736.9M186](/packages/opis-json-schema)[kiczort/polish-validator

Validators for Polish identification numbers: PESEL, NIP, REGON.

11122.8k5](/packages/kiczort-polish-validator)[laminas/laminas-validator

Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria

15644.9M188](/packages/laminas-laminas-validator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
