PHPackages                             petrabarus/yii2-eithervalidator - 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. petrabarus/yii2-eithervalidator

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

petrabarus/yii2-eithervalidator
===============================

Yii2 validator to force one of certain attributes to be filled

115.4k2[1 issues](https://github.com/petrabarus/yii2-eithervalidator/issues)PHP

Since Feb 12Pushed 11y ago2 watchersCompare

[ Source](https://github.com/petrabarus/yii2-eithervalidator)[ Packagist](https://packagist.org/packages/petrabarus/yii2-eithervalidator)[ RSS](/packages/petrabarus-yii2-eithervalidator/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

yii2-eithervalidator
====================

[](#yii2-eithervalidator)

Yii2 validator to force one of attributes to be filled.

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

[](#installation)

Add the following line to the composer.

```
"petrabarus/yii2-eithervalidator": "*"

```

Usage
-----

[](#usage)

Add the a line similar to the following to rule of the model

```
[['email'], PetraBarus\Yii2\Validators\EitherValidator::class,
	'otherAttributes' => ['phone']]
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

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/c1261f29f95a5ca228a04c8415431baf0fb6c397ec83e93e3454fb0b55718c5e?d=identicon)[petrabarus](/maintainers/petrabarus)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/petrabarus-yii2-eithervalidator/health.svg)

```
[![Health](https://phpackages.com/badges/petrabarus-yii2-eithervalidator/health.svg)](https://phpackages.com/packages/petrabarus-yii2-eithervalidator)
```

###  Alternatives

[chaoswey/taiwan-id-validator

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

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

PHPackages © 2026

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