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

ActiveLibrary

narokishi/object-validator
==========================

PHP package to validate objects

111[1 PRs](https://github.com/narokishi/object-validator/pulls)PHP

Since Sep 1Pushed 6y agoCompare

[ Source](https://github.com/narokishi/object-validator)[ Packagist](https://packagist.org/packages/narokishi/object-validator)[ RSS](/packages/narokishi-object-validator/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Object Validator
================

[](#object-validator)

BuildCoverageDownloadsReleaseLicense[![Build Status](https://camo.githubusercontent.com/a0d760fd7bd8bc9303cb4ffc219643c0319a87a1ae024ef2d13d5693e25f8fdb/68747470733a2f2f7472617669732d63692e636f6d2f6e61726f6b697368692f6f626a6563742d76616c696461746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/narokishi/object-validator)[![Coverage Status](https://camo.githubusercontent.com/2a33caee65973500a372713b614d34caf78ee2312ae3accec63455e50d21b42d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e61726f6b697368692f6f626a6563742d76616c696461746f722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/narokishi/object-validator?branch=master)[![Total Downloads](https://camo.githubusercontent.com/5a2d7495df71a611a29be3a897b30e1e26fb4c55a0dacf11129c3c765a8043eb/68747470733a2f2f706f7365722e707567782e6f72672f6e61726f6b697368692f6f626a6563742d76616c696461746f722f646f776e6c6f616473)](https://packagist.org/packages/narokishi/object-validator)[![Latest Stable Version](https://camo.githubusercontent.com/678b8929ce57be0c54effa9faf1a226bde506bbb096e1b79915f4594e6c216d7/68747470733a2f2f706f7365722e707567782e6f72672f6e61726f6b697368692f6f626a6563742d76616c696461746f722f762f737461626c65)](https://packagist.org/packages/narokishi/object-validator)[![License](https://camo.githubusercontent.com/17c972d8edb9acb0f22a14838178359e42435332d32deaa9eb89429db61eaef4/68747470733a2f2f706f7365722e707567782e6f72672f6e61726f6b697368692f6f626a6563742d76616c696461746f722f6c6963656e7365)](https://packagist.org/packages/narokishi/object-validator)Description
-----------

[](#description)

"ObjectValidator" is a **PHP** package, which allows to validate given class (eg. stdClass incoming from request) to be validated with custom rules. Strongly recommended for generic views.

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

[](#installation)

### Composer

[](#composer)

Installing via [Composer](https://getcomposer.org/download/) will keep this package up to date for you.

```
composer require narokishi/object-validator
```

### Usage

[](#usage)

```
use Narokishi\ObjectValidator\Validators\CompensationValidator;
use Narokishi\ObjectValidator\ValidationException;

...

try {
    (new CompensationValidator($class))
        ->applyPrefix('compensation')
        ->withThrow();
} catch (ValidationException $e) {
    // Apply errors to view or whatever
}
```

Contributing
------------

[](#contributing)

Thank you for considering contributing to the package.

### Running tests

[](#running-tests)

```
composer tests
composer tests-windows
```

### Submitting a Patch

[](#submitting-a-patch)

- Fork the Repository
- After the action has completed, clone your fork locally

```
git clone git@github.com:{username}/object-validator.git
cd number-to-words
git remote add upstream git://github.com/narokishi/object-validator.git
```

- Check that tests pass
- Create and work on your own topic branch

```
git checkout -b {branch} master
```

- Prepare your patch (while rebasing you might have to resolve conflicts)

```
git checkout master
git fetch upstream
git merge upstream/master
git checkout BRANCH_NAME
git rebase master
```

- In case of conflicts

```
 git add {files}
 git rebase --continue
```

- Check that all tests pass and push your branch

```
 git push origin {branch} --force
```

- Make a Pull Request on narokishi/object-validator repository

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/32cf09f2a800b85dca4656ae2065b038f9fd52088e3f7d34864883833ec53deb?d=identicon)[Narokishi](/maintainers/Narokishi)

---

Top Contributors

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

### Embed Badge

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

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

PHPackages © 2026

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