PHPackages                             miserenkov/yii2-phone-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. miserenkov/yii2-phone-validator

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

miserenkov/yii2-phone-validator
===============================

Yii2 phone validator

v1.2(3y ago)023.8k↑157.1%1MITPHPPHP &gt;=7.1

Since Mar 5Pushed 1y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (8)Versions (4)Used By (0)

Yii2 Phone Validator
====================

[](#yii2-phone-validator)

Yii2 validator for phone numbers

[![License](https://camo.githubusercontent.com/3ee443a2fb08430ce0ad1f434be6451786f51c4125b0c53605d09c90ed7ae461/68747470733a2f2f706f7365722e707567782e6f72672f6d69736572656e6b6f762f796969322d70686f6e652d76616c696461746f722f6c6963656e7365)](https://packagist.org/packages/miserenkov/yii2-phone-validator)[![Latest Stable Version](https://camo.githubusercontent.com/bd41fbdd3e97d5ba9817ea85aac0040cbb4004b83880884c7f0d3663ecb26b06/68747470733a2f2f706f7365722e707567782e6f72672f6d69736572656e6b6f762f796969322d70686f6e652d76616c696461746f722f762f737461626c65)](https://packagist.org/packages/miserenkov/yii2-phone-validator)[![Latest Unstable Version](https://camo.githubusercontent.com/4e25627a2be1ec96eff87e14fd52da7a1db021ec274c72e5c329e36bd9cdb8ed/68747470733a2f2f706f7365722e707567782e6f72672f6d69736572656e6b6f762f796969322d70686f6e652d76616c696461746f722f762f756e737461626c65)](https://packagist.org/packages/miserenkov/yii2-phone-validator)[![Total Downloads](https://camo.githubusercontent.com/297d688c39c0b0ace59072d2415fd15f2e8760bea5cc015db2dab8b54fe0e133/68747470733a2f2f706f7365722e707567782e6f72672f6d69736572656e6b6f762f796969322d70686f6e652d76616c696461746f722f646f776e6c6f616473)](https://packagist.org/packages/miserenkov/yii2-phone-validator)[![Build Status](https://camo.githubusercontent.com/f14504aa727fdeebc58e12c91d6d400bdbf145155d9478b4a25acd1784846927/68747470733a2f2f7472617669732d63692e6f72672f6d69736572656e6b6f762f796969322d70686f6e652d76616c696461746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/miserenkov/yii2-phone-validator)

Support
-------

[](#support)

[GitHub issues](https://github.com/miserenkov/yii2-phone-validator).

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist miserenkov/yii2-phone-validator "^1.0"

```

or add

```
"miserenkov/yii2-phone-validator": "^1.0"

```

to the require section of your `composer.json` file.

Basic usages
------------

[](#basic-usages)

#### With fixed country value

[](#with-fixed-country-value)

```
public function rules()
{
    return [
        // ...
        ['phone', \miserenkov\validators\PhoneValidator::className(), 'country' => 'UA'],
        // ...
    ];
}
```

#### With fixed country attribute

[](#with-fixed-country-attribute)

```
public function rules()
{
    return [
        // ...
        ['country', 'string'],
        ['phone', \miserenkov\validators\PhoneValidator::className(), 'countryAttribute' => 'country'],
        // ...
    ];
}
```

#### With fixed countries value

[](#with-fixed-countries-value)

```
public function rules()
{
    return [
        // ...
        ['phone', \miserenkov\validators\PhoneValidator::className(), 'countries' => ['UA', 'RU', 'US', /*...*/]],
        // ...
    ];
}
```

#### With all countries

[](#with-all-countries)

```
public function rules()
{
    return [
        // ...
        ['phone', \miserenkov\validators\PhoneValidator::className()],
        // ...
    ];
}
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~1108 days

Total

3

Last Release

1191d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2da4989419ba449f8a65c166d33be4472ab6a37d3e55092f17e8ac9eba5b3574?d=identicon)[miserenkov](/maintainers/miserenkov)

---

Top Contributors

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

---

Tags

validatorphoneyii2

###  Code Quality

TestsCodeception

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/miserenkov-yii2-phone-validator/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.8k59](/packages/skeeks-cms)[paulzi/yii2-json-behavior

Yii2 json attribute behavior

75546.8k3](/packages/paulzi-yii2-json-behavior)[codeonyii/yii2-at-least-validator

Validates at least one (or more) attributes.

28263.7k1](/packages/codeonyii-yii2-at-least-validator)[arogachev/yii2-many-to-many

Many-to-many ActiveRecord relation for Yii 2 framework

3643.1k4](/packages/arogachev-yii2-many-to-many)

PHPackages © 2026

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