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

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

reflection/validator
====================

Define a specification of PHP entity and check whether the particular item matches it.

1.0.1(8y ago)4191.4k—5%[1 issues](https://github.com/BR0kEN-/reflection-validator/issues)[1 PRs](https://github.com/BR0kEN-/reflection-validator/pulls)MITPHPPHP &gt;=7.0

Since Aug 1Pushed 4y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Reflection Validator
====================

[](#reflection-validator)

[![Build Status](https://camo.githubusercontent.com/901fe7bb4bde923289d073af6e1b5341d0403fb7efda98e08e5bab8b4bab69a3/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4252306b454e2d2f7265666c656374696f6e2d76616c696461746f722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/BR0kEN-/reflection-validator)[![Code coverage](https://camo.githubusercontent.com/40d36d13a4d1950b29c761e41c257181f0aafc07de34b39e6d6c4e750532d880/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f4252306b454e2d2f7265666c656374696f6e2d76616c696461746f722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/BR0kEN-/reflection-validator/?branch=master)[![Quality Score](https://camo.githubusercontent.com/37fc7653bc185e981166738ff7352e78f864152b01019dd452caeccf9eb6d1b5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f4252306b454e2d2f7265666c656374696f6e2d76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/BR0kEN-/reflection-validator)[![Total Downloads](https://camo.githubusercontent.com/e7dd1b52bd59c0839d985d74d73700b2b6ed598bd1dea7693d6cff6115e7d0f6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7265666c656374696f6e2f76616c696461746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/reflection/validator)[![Latest Stable Version](https://camo.githubusercontent.com/b607a3667a8776e3b85180e99e70bf09f1a185297d51b0a092a6a9ea0f090c87/68747470733a2f2f706f7365722e707567782e6f72672f7265666c656374696f6e2f76616c696461746f722f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/reflection/validator)[![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/reflection/validator)

When might it be useful?
------------------------

[](#when-might-it-be-useful)

Sometimes you may want to have an unlimited sequence of methods, which cannot be restricted/controlled by the interface. In this case on a "compilation" stage, you can restrict those methods to follow the standards you expect.

A real example from Drupal/Symfony world: [http://cgit.drupalcode.org/form\_alter\_service/tree/src/FormAlterCompilerPass.php](http://cgit.drupalcode.org/form_alter_service/tree/src/FormAlterCompilerPass.php)

Examples
--------

[](#examples)

Besides of [fully-operable examples](examples), you can check a quick use case:

```
(new MethodValidator(object, string))
    ->addArgument(
        (new ArgumentSpecification('form'))
            ->setType('array')
            ->setOptional(false)
            ->setPassedByReference(true)
    )
    ->addArgument(
        (new ArgumentSpecification('formState'))
            ->setType(Iterator::class)
            ->setOptional(false)
            ->setPassedByReference(false)
    );
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Total

2

Last Release

2968d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e8b4c73b9ba0729e2c5b690cbdb63bfbe982130513b0c9d64c6c26e1d4d32ff?d=identicon)[BR0kEN-](/maintainers/BR0kEN-)

---

Top Contributors

[![BR0kEN-](https://avatars.githubusercontent.com/u/2760616?v=4)](https://github.com/BR0kEN- "BR0kEN- (20 commits)")

---

Tags

phpphp7reflectionreflection-libraryvalidationvalidatorvalidatorreflectionvalidatefunctionmethod

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[wixel/gump

A fast, extensible &amp; stand-alone PHP input validation class that allows you to validate any data.

1.2k1.3M30](/packages/wixel-gump)[sadegh19b/laravel-persian-validation

A comprehensive Laravel validation package for Persian text, numbers, dates, and Iranian national identifiers

18293.8k1](/packages/sadegh19b-laravel-persian-validation)[awurth/slim-validation

A wrapper around the respect/validation PHP validation library for easier error handling and display

65378.4k9](/packages/awurth-slim-validation)[romeoz/rock-validate

Flexible validator for PHP with I18N.

251.7k6](/packages/romeoz-rock-validate)

PHPackages © 2026

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