PHPackages                             lsys/validation - 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. lsys/validation

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

lsys/validation
===============

lsys module validation

0.0.1(6y ago)01471Apache-2.0PHPCI failing

Since Jul 3Pushed 6y agoCompare

[ Source](https://github.com/php-lsys/validation)[ Packagist](https://packagist.org/packages/lsys/validation)[ RSS](/packages/lsys-validation/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (4)Versions (2)Used By (1)

数组校验
====

[](#数组校验)

> 实现对数据的有效性的校验,常用的$\_POST 和$\_GET的有效性的检测

示例代码:

```
use LSYS\Validation;
include __DIR__."/Bootstarp.php";
//$data=$_POST;
$data=array(
	"username"=>"ddddd",
);
$validation = Validation::factory($data);
//给字段添加别名,显示用
$validation->label("username",__("username"));
//添加判断规则
$validation->rule('username', 'not_empty')
	->rule('username', 'min_length', array(':value', 4))
	->rule("username",function($valid,$value){
	//自定义校验函数
	//添加错误消息,校验未通过时赋值
	$valid->error("username", "bbbb");
	$valid->message("username.bbbb",__("bad msg"));
	},array(':validation',':value')/*第三个参数为参数定义*/);
//进行校验
if (!$validation->check()){
	//校验未通过
	print_r($validation->errors(TRUE));
}
```

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% 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

Unknown

Total

1

Last Release

2226d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f1652fec3beae86de90c6615dd28be4729251e1b2bb08f1cd18e8193e6c4e48?d=identicon)[lsys](/maintainers/lsys)

---

Top Contributors

[![shanliu](https://avatars.githubusercontent.com/u/2927231?v=4)](https://github.com/shanliu "shanliu (9 commits)")[![php-lsys](https://avatars.githubusercontent.com/u/43031308?v=4)](https://github.com/php-lsys "php-lsys (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lsys-validation/health.svg)

```
[![Health](https://phpackages.com/badges/lsys-validation/health.svg)](https://phpackages.com/packages/lsys-validation)
```

###  Alternatives

[hybridlogic/validation

A simple, extensible validation library for PHP with support for filtering and validating any input array along with generating client side validation code.

641.1k](/packages/hybridlogic-validation)

PHPackages © 2026

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