PHPackages                             mithridatem/validation - 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. mithridatem/validation

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

mithridatem/validation
======================

Attribute-based validation components

v0.1.3(8mo ago)7241↓92.3%1MITPHPPHP &gt;=8.2CI passing

Since Oct 19Pushed 8mo agoCompare

[ Source](https://github.com/evaluationWeb/validation-librairie)[ Packagist](https://packagist.org/packages/mithridatem/validation)[ RSS](/packages/mithridatem-validation/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (1)Versions (5)Used By (0)

Mithridatem Validation
======================

[](#mithridatem-validation)

Librairie de validation basee sur les attributs PHP 8.2+. Elle permet d'annoter vos entites avec des contraintes et de les verifier via la classe `Validator`.

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

[](#installation)

```
composer require mithridatem/validation
```

Utilisation
-----------

[](#utilisation)

```
use Mithridatem\Validation\Validator;
use Mithridatem\Validation\Attributes\NotBlank;
use Mithridatem\Validation\Attributes\Length;

class Utilisateur
{
    #[NotBlank]
    #[Length(min: 3, max: 50)]
    private string $prenom;
}

$validator = new Validator();
$validator->validate(new Utilisateur());
```

En cas d'echec, le `Validator` leve une `Mithridatem\Validation\Exception\ValidationException`. Interceptez cette exception pour afficher ou journaliser le message.

Contraintes disponibles
-----------------------

[](#contraintes-disponibles)

- `NotBlank` : interdit les valeurs nulles ou les chaines vides
- `Length` : impose une longueur minimale et/ou maximale
- `Email` : valide une adresse electronique avec `FILTER_VALIDATE_EMAIL`
- `Pattern` : impose un pattern regex à une string
- `Negative` : impose une valeur négative à un entier
- `NegativeOrZero` : impose une valeur négative ou égale à zéro à un entier
- `Positive` : impose une valeur positive à un entier
- `PositiveOrZero` : impose une valeur positive ou égale à zéro à un entier

Developpement
-------------

[](#developpement)

```
composer install
composer test
```

Licence
-------

[](#licence)

Le projet est distribue sous licence MIT. Voir [LICENSE](LICENSE).

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance60

Regular maintenance activity

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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

Total

4

Last Release

256d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/72612782?v=4)[mithridatem](/maintainers/mithridatem)[@mithridatem](https://github.com/mithridatem)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mithridatem-validation/health.svg)

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

###  Alternatives

[marcosh/php-validation-dsl

A DSL for validating data in a functional fashion

483.9k](/packages/marcosh-php-validation-dsl)

PHPackages © 2026

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