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

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

omasn/reflection-validator
==========================

Extends the capability of the symfony validator

1.0.0(2y ago)11.3kMITPHPPHP &gt;=8.2

Since Jun 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Fuck4ik/reflection-validator)[ Packagist](https://packagist.org/packages/omasn/reflection-validator)[ Docs](https://github.com/code-pilots/change-set-collection)[ RSS](/packages/omasn-reflection-validator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

ReflectionValidator Util
========================

[](#reflectionvalidator-util)

Extends the capability of the symfony validator

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

[](#installation)

Install the latest version with

```
$ composer require omasn/reflection-validator
```

Basic Usage
-----------

[](#basic-usage)

### Example 1:

[](#example-1)

```
class A {
    public int $number;
    /** @var B[] */
    public array $rows;
}
class B {
    public int $number;
    /** @var C[] */
    public array $rows;
}
class C {
    #[Assert\Positive]
    public int $number;
}

$reflValidator = Omasn\ReflectionValidator\ReflectionValidator::createSimple();

$violations = $reflValidator->validate(A::class, [
    'number' => 0,
    'rows' => [
        [
            'number' => 0,
            'rows' => [
                [
                    'number' => -1,
                ],
            ],
        ],
    ],
]);

self::assertEquals(1, $violations->count());
```

For contributors
----------------

[](#for-contributors)

### Install cs-fixer

[](#install-cs-fixer)

`mkdir -p tools/php-cs-fixer``composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer`

### Run tests

[](#run-tests)

Exec: `./vendor/bin/phpunit`

### Run lint

[](#run-lint)

Exec cs-fixer: `tools/php-cs-fixer/vendor/bin/php-cs-fixer fix src`Exec phpstan: `./vendor/bin/phpstan analyse src tests`Exec psalm: `./vendor/bin/psalm`

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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

1068d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/18ad25a37dcf8186c37b847a53a7a20fe7ae33ccd6d809d98650f6523b687731?d=identicon)[Fuck4ik](/maintainers/Fuck4ik)

---

Tags

phpsymfony-validatorreflection-validator

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[api-platform/serializer

API Platform core Serializer

223.4M31](/packages/api-platform-serializer)[kiczort/polish-validator-bundle

Symfony bundle with validators for Polish identification numbers: PESEL, NIP, REGON, PWZ.

1223.2k](/packages/kiczort-polish-validator-bundle)

PHPackages © 2026

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