PHPackages                             dabrahim/array-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. dabrahim/array-validator

ActiveLibrary

dabrahim/array-validator
========================

Array validator for PHP. Useful to handle $\_GET / $\_POST arrays.

v1.2.0(7y ago)017MITPHPPHP &gt;=5.4.0

Since Oct 19Pushed 7y agoCompare

[ Source](https://github.com/dabrahim/array-validator)[ Packagist](https://packagist.org/packages/dabrahim/array-validator)[ Docs](https://github.com/dabrahim/array-validator)[ RSS](/packages/dabrahim-array-validator/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)DependenciesVersions (7)Used By (0)

ArrayValidator
==============

[](#arrayvalidator)

A custom library made to take away the pain of form data validation. Pretty useful for validating **$\_POST** and **$\_GET** arrays

Getting started
---------------

[](#getting-started)

1. PHP 5.4.x is required
2. [composer](https://getcomposer.org/download/) is required
3. Change to your working directory and run `composer require dabrahim/array-validator`

Basic usage
-----------

[](#basic-usage)

```
$constraints = array(
    'email' => (object)[
        'prettyName' => 'E-mail',
        'type' => ArrayValidator::TYPE_EMAIL,
    ],
    'firstName' => (object) [
        'prettyName' => 'Prénom',
        'type' => ArrayValidator::TYPE_NAME
    ],
    'lastName' => (object) [
        'prettyName' => 'Nom',
        'type' => ArrayValidator::TYPE_NAME
    ]
);

$a = array(
    'email' => 'john.doe@gmail.com',
    'lastName' => 'Doe',
    'firstName' => 'John'
);

try {
    $av = new ArrayValidator($a, $constraints);
    $av->validate();

    echo "Tout est OK !";

} catch (InvalidValueFormat $e) {
    echo "User error: " .$e->getMessage();

} catch (MissingKeyException $e) {
    echo "User error: " . $e->getMessage();

} catch (Exception $e) {
    echo "Developer error: " . $e->getMessage();
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

2765d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.0

v1.1.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/21107734?v=4)[Ibrahima NDIAYE](/maintainers/dabrahim)[@dabrahim](https://github.com/dabrahim)

---

Top Contributors

[![dabrahim](https://avatars.githubusercontent.com/u/21107734?v=4)](https://github.com/dabrahim "dabrahim (7 commits)")

### Embed Badge

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

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

PHPackages © 2026

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