PHPackages                             data-values/validators - 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. data-values/validators

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

data-values/validators
======================

Common ValueValidator implementations

1.0.0(5y ago)1700.7k↑74.4%46GPL-2.0-or-laterPHPPHP &gt;=7.2CI passing

Since Nov 17Pushed 4mo ago12 watchersCompare

[ Source](https://github.com/DataValues/Validators)[ Packagist](https://packagist.org/packages/data-values/validators)[ Docs](https://github.com/DataValues/Validators)[ RSS](/packages/data-values-validators/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (6)Used By (6)

DataValues Validators
=====================

[](#datavalues-validators)

DataValues Validators is a small library that contains common ValueValidator implementations.

It is part of the [DataValues set of libraries](https://github.com/DataValues).

[![Code Coverage](https://camo.githubusercontent.com/8c78ec561a4abe463e4b831c27b1f74fa7e90b4960b15697b4d5dc587cdeef2a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4461746156616c7565732f56616c696461746f72732f6261646765732f636f7665726167652e706e673f733d36373765353362326661623733613062666164346161626533663232396632663964323837613030)](https://scrutinizer-ci.com/g/DataValues/Validators/)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/8ed551fdcf1178503f25a36975346ce7097a95e061f165e9b39c0237c00621ff/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4461746156616c7565732f56616c696461746f72732f6261646765732f7175616c6974792d73636f72652e706e673f733d36653565376163383535376237313737393236653839653339333837653733663062663837666533)](https://scrutinizer-ci.com/g/DataValues/Validators/)

On [Packagist](https://packagist.org/packages/data-values/validators): [![Latest Stable Version](https://camo.githubusercontent.com/4027253ae0f67d133f282e7da3bd9e2fa8b77c56e41b5e2ced42bb46eebc0a71/68747470733a2f2f706f7365722e707567782e6f72672f646174612d76616c7565732f76616c696461746f72732f76657273696f6e2e706e67)](https://packagist.org/packages/data-values/validators)[![Download count](https://camo.githubusercontent.com/cff916b529bcdc953e34334e9e85f68a91a2afc2cee1a0acaa4c766560d918b7/68747470733a2f2f706f7365722e707567782e6f72672f646174612d76616c7565732f76616c696461746f72732f642f746f74616c2e706e67)](https://packagist.org/packages/data-values/validators)

Installation
------------

[](#installation)

The recommended way to use this library is via [Composer](http://getcomposer.org/).

### Composer

[](#composer)

To add this package as a local, per-project dependency to your project, simply add a dependency on `data-values/validators` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on version 1.0 of this package:

```
{
    "require": {
        "data-values/validators": "1.0.*"
    }
}

```

### Manual

[](#manual)

Get the code of this package, either via git, or some other means. Also get all dependencies. You can find a list of the dependencies in the "require" section of the composer.json file. Then take care of autoloading the classes defined in the src directory.

Tests
-----

[](#tests)

This library comes with a set up PHPUnit tests that cover all non-trivial code. You can run these tests using the PHPUnit configuration file found in the root directory. The tests can also be run via Github Actions.

Authors
-------

[](#authors)

DataValues Validators has been written by the Wikidata team, as [Wikimedia Germany](https://wikimedia.de)employees for the [Wikidata project](https://wikidata.org/).

It is based upon and contains a lot of code written by [Jeroen De Dauw](https://github.com/JeroenDeDauw)for the [Maps](https://github.com/JeroenDeDauw/Maps) and [Semantic MediaWiki](https://semantic-mediawiki.org/) projects.

Release notes
-------------

[](#release-notes)

### 1.0.0 (2021-01-22)

[](#100-2021-01-22)

- Added compatibility with `data-values/data-values` 3.x
- Added compatibility with `data-values/interfaces` 1.x

### 0.1.3 (2018-08-02)

[](#013-2018-08-02)

- Made component installable with DataValues 2.x
- Removed MediaWiki integration

### 0.1.2 (2014-10-09)

[](#012-2014-10-09)

- Made component installable with DataValues 1.x

### 0.1.1 (2014-03-27)

[](#011-2014-03-27)

- Changed autoloading from PSR-0 to PSR-4
- Added tests for DimensionValidator

### 0.1.0 (2013-11-17)

[](#010-2013-11-17)

Initial release with these features:

- DimensionValidator
- ListValidator
- NullValidator
- RangeValidator
- StringValidator
- TitleValidator

Links
-----

[](#links)

- [DataValues Validators on Packagist](https://packagist.org/packages/data-values/validators)
- [DataValues Validators on ScrutinizerCI](https://scrutinizer-ci.com/g/DataValues/Validators/)

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance52

Moderate activity, may be stable

Popularity41

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~655 days

Total

5

Last Release

1942d ago

Major Versions

0.1.3 → 1.0.02021-01-22

PHP version history (3 changes)0.1PHP &gt;=5.3.0

0.1.3PHP &gt;=5.5.9

1.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/451bd4039d530fed8f9c3da91bfa519233a397d2182cdfdcad700f6cfea19b7f?d=identicon)[Jeroen De Dauw](/maintainers/Jeroen%20De%20Dauw)

![](https://avatars.githubusercontent.com/u/22235?v=4)[Stefan Wasilewski](/maintainers/SMW)[@smw](https://github.com/smw)

![](https://www.gravatar.com/avatar/0c1ddc1309ce2f268d42afc35c3065421f8a6d21e4ca25eb338db3a297cdef1b?d=identicon)[DataValues](/maintainers/DataValues)

---

Top Contributors

[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (44 commits)")[![thiemowmde](https://avatars.githubusercontent.com/u/6576639?v=4)](https://github.com/thiemowmde "thiemowmde (16 commits)")[![mariushoch](https://avatars.githubusercontent.com/u/2446964?v=4)](https://github.com/mariushoch "mariushoch (7 commits)")[![addshore](https://avatars.githubusercontent.com/u/3308769?v=4)](https://github.com/addshore "addshore (7 commits)")[![rosalieper](https://avatars.githubusercontent.com/u/15235452?v=4)](https://github.com/rosalieper "rosalieper (7 commits)")[![reedy](https://avatars.githubusercontent.com/u/67615?v=4)](https://github.com/reedy "reedy (5 commits)")[![manicki](https://avatars.githubusercontent.com/u/3524114?v=4)](https://github.com/manicki "manicki (2 commits)")[![Ladsgroup](https://avatars.githubusercontent.com/u/5351225?v=4)](https://github.com/Ladsgroup "Ladsgroup (1 commits)")

---

Tags

validationvalidatorswikidatadatavalues

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/data-values-validators/health.svg)

```
[![Health](https://phpackages.com/badges/data-values-validators/health.svg)](https://phpackages.com/packages/data-values-validators)
```

###  Alternatives

[composer/semver

Version comparison library that offers utilities, version constraint parsing and validation.

3.3k489.6M672](/packages/composer-semver)[giggsey/libphonenumber-for-php

A library for parsing, formatting, storing and validating international phone numbers, a PHP Port of Google's libphonenumber.

5.0k148.7M416](/packages/giggsey-libphonenumber-for-php)[respect/validation

The most awesome validation engine ever created for PHP

5.9k37.4M383](/packages/respect-validation)[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k35.7M107](/packages/propaganistas-laravel-phone)[opis/json-schema

Json Schema Validator for PHP

64736.9M186](/packages/opis-json-schema)[giggsey/libphonenumber-for-php-lite

A lite version of giggsey/libphonenumber-for-php, which is a PHP Port of Google's libphonenumber

8912.9M47](/packages/giggsey-libphonenumber-for-php-lite)

PHPackages © 2026

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