PHPackages                             mrbig00/yii2-class-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. mrbig00/yii2-class-validator

ActiveYii2-extension[Validation &amp; Sanitization](/categories/validation)

mrbig00/yii2-class-validator
============================

This validator test if an object (instance) is a subtype of a given class

010PHP

Since Aug 30Pushed 6y ago1 watchersCompare

[ Source](https://github.com/mrbig00/yii2-class-validator)[ Packagist](https://packagist.org/packages/mrbig00/yii2-class-validator)[ RSS](/packages/mrbig00-yii2-class-validator/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

YII2 Class validator
====================

[](#yii2-class-validator)

ClassValidator checks if the attribute is a subtype of a given class

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

[](#installation)

Use the package manager [composer](https://getcomposer.org/) to install the Yii2 class validator.

```
composer require mrbig00/yii2-class-validator
```

Usage
-----

[](#usage)

```
public function rules(){
   return [
      [['client'], ClassValidator::class, 'skipOnEmpty' => false, 'targetClass' => Client::class],
      ...
   ];
}
```

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

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/037459e6f2108dc0ec4f46e717afe6f9abd7a6e833062aa8b9c634ada9324c74?d=identicon)[mrbig00](/maintainers/mrbig00)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/mrbig00-yii2-class-validator/health.svg)

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

###  Alternatives

[chaoswey/taiwan-id-validator

台灣身分證、統一編號驗證

319.9k](/packages/chaoswey-taiwan-id-validator)

PHPackages © 2026

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