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

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

mitsuki/validators
==================

A Symfony Validator–based request validation layer for PHP, providing an abstract RequestValidator and structured ValidationException for HTTP 422 responses.

v1.0.0(3mo ago)10PHPCI passing

Since Feb 16Pushed 3mo agoCompare

[ Source](https://github.com/zgeniuscoders/mitsuki-validation)[ Packagist](https://packagist.org/packages/mitsuki/validators)[ RSS](/packages/mitsuki-validators/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Mitsuki Validators
==================

[](#mitsuki-validators)

A lightweight request validation layer built on top of Symfony Validator, designed to work seamlessly with custom HTTP requests in PHP applications.

Features
--------

[](#features)

- Abstract `RequestValidator` class that merges query, request body, and files into a single dataset.
- Easy rule definition via the `rules()` method using Symfony `Constraint` objects.
- Throws a structured `ValidationException` (HTTP 422) when validation fails.
- Clean, reusable validators for your API or web controllers.

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

[](#installation)

Install the package via Composer:

```
composer require mitsuki/hermite-validators
```

1. Create a validator class extending RequestValidator:

```
use Mitsuki\Hermite\Validators\RequestValidator;
use Symfony\Component\Validator\Constraints as Assert;

class CreateUserRequest extends RequestValidator
{
    public function rules(): array
    {
        return [
            'email' => [new Assert\Email(), new Assert\NotBlank()],
            'age'   => [new Assert\Type('numeric'), new Assert\GreaterThan(17)],
        ];
    }
}
```

2. Inject request data (e.g., in tests or controllers) and validate:

```
$request = new CreateUserRequest();
$request->initialize(
    [], // GET
    ['email' => 'user@example.com', 'age' => 25]
);

$request->validateOrFail(); // Throws ValidationException on failure
```

3. Catch and inspect validation errors:

```
use Mitsuki\Hermite\Validators\Exceptions\ValidationException;

try {
    $request->validateOrFail();
} catch (ValidationException $e) {
    $errors = $e->getErrors();
    // $errors['email'] = 'This value is not a valid email address.'
}
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance82

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

91d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/59ea5d2ce29d5426a3d7feabbcc7b07772b03dd80e4cd13afd6f9ac5e0469998?d=identicon)[zgenius](/maintainers/zgenius)

---

Top Contributors

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

---

Tags

validationform validationhttp requestphp-validationapi-validationsymfony-validatorrequest-validator

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[pearl/lumen-request-validate

Lumen doesn't have form request validator seperatly. This package helps developers to segregate the validation layer from the controller to a separate dedicated class

45390.3k2](/packages/pearl-lumen-request-validate)[bitapps/wp-validator

WordPress Validation and Sanitization Library

127.4k1](/packages/bitapps-wp-validator)

PHPackages © 2026

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