PHPackages                             xiangshouding/ep-validate - 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. xiangshouding/ep-validate

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

xiangshouding/ep-validate
=========================

Another validate tool

06PHP

Since Nov 4Pushed 9y ago1 watchersCompare

[ Source](https://github.com/xiangshouding/ep-validate)[ Packagist](https://packagist.org/packages/xiangshouding/ep-validate)[ RSS](/packages/xiangshouding-ep-validate/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

ep-validate
===========

[](#ep-validate)

Another validate tool

说明
--

[](#说明)

校验参数可能是遇到最多的问题，特别是在导入数据的时候。一个定义清晰的校验工具就不可获取了。

宏观的去考察一下，有个 json schema 的项目特别令人愉悦，但奈何类库代码颇多，有时候校验并不需要引入如此庞大的一套体系。

在纠结了几天后，决定还是简单来一个吧，自己用着比较舒服，遂放到这块。

安装
--

[](#安装)

```
composer install xiangshouding/ep-validate

```

使用
--

[](#使用)

```
$data = array(
    'name' => 'bozlll',
    'age' => 27,
    'gender' => 'm',
    'ext' => array(
        'school' => 'HIT',
        'class' => 4
    )
);

$rules = array(
    'name' => 'required|string|max:30',
    'age' => 'required|int',
    'gender' => 'required|enum:m,f',
    'ext' => '$ref:ext',
    '$define' => array(
        'ext' => array(
            'school' => 'string',
            'class' => 'string'
        )
    ),
);

$validate = new Ep_Validate($data, $rules);

if (!$validate->ok()) {
    throw new Exception($validate->getValidateError());
}

...
```

检验规则
----

[](#检验规则)

...

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

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/6187fb849f337554f1515012aedd06d55365e8ac6f170cbadfaaf94d5e3790cd?d=identicon)[xiangshouding](/maintainers/xiangshouding)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/xiangshouding-ep-validate/health.svg)

```
[![Health](https://phpackages.com/badges/xiangshouding-ep-validate/health.svg)](https://phpackages.com/packages/xiangshouding-ep-validate)
```

###  Alternatives

[chaoswey/taiwan-id-validator

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

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

PHPackages © 2026

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