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 2mo 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

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

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

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[nette/forms

📝 Nette Forms: generating, validating and processing secure forms in PHP. Handy API, fully customizable, server &amp; client side validation and mature design.

54013.2M450](/packages/nette-forms)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)

PHPackages © 2026

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