PHPackages                             rain\_sunshine\_cloud/request - 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. rain\_sunshine\_cloud/request

ActiveLibrary

rain\_sunshine\_cloud/request
=============================

这是一起请求接收参数类

v1.0(7y ago)012PHP

Since Apr 5Pushed 6y agoCompare

[ Source](https://github.com/RainSunshineCloud/request)[ Packagist](https://packagist.org/packages/rain_sunshine_cloud/request)[ RSS](/packages/rain-sunshine-cloud-request/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (0)

### 这是一个接收请求参数的封装类

[](#这是一个接收请求参数的封装类)

#### 说明

[](#说明)

1. 支持post get serv(获取$\_SERVER) patch delete put 请求
2. 支持json格式的payload请求方式 (通过setDataType 设置数据来源)
3. 自带类型转换（如 int 会自动帮忙转为 int)
4. 支持链式操作，
5. 支持验证其他数据源，通过 data($data)
6. 支持默认值操作
7. 支持闭包验证
8. 支持自定义的类验证
9. 采用异常抛出的方式，返回错误信息
10. 灵活的第三方参数传递
11. 支持单例

#### 基本用法

[](#基本用法)

```

class Test {
	public static function int($val,$err_message,$other_params)
	{
		return 2343;
	}

	public function float($val,$err_message,$other_params)
	{
		return 23423;
	}
}
try {
	$_POST['a'] = 2;
	//使用方法1
	$request = new Request();
	$res = $request->check('a','int','必须是整数1')->post('a');

	//使用方法2
	$res = Request::instance()->check('a','int','必须是整数2')->post(['a','b','c' => '1']);

	//使用方法3
	$res = Request::instance()->check('a','int','必须是整数2')->check('c','float','必须大于4',['min' => 4])->post(['a','b','c' => '4']);
	//使用方法4
	$res = Request::instance()->check('a',['test','int'],'必须是整数2')->check('c','float','必须大于4',['min' => 4])->post(['a','b','c' => '4']);

	//使用方法5
	$res = Request::instance()->check('a',[new Test(),'int'],'必须是整数2')->check('c','float','必须大于4',['min' => 4])->post(['a','b','c' => '4']);

	var_dump($res);
} catch (RequestException $e) {
	echo $e->getMessage();
}

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2597d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/041cb2d7e5d63d922726b229061fd63ca04abca4dce719fba94eb1dc4129aaea?d=identicon)[RainSunshineCloud](/maintainers/RainSunshineCloud)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/rain-sunshine-cloud-request/health.svg)

```
[![Health](https://phpackages.com/badges/rain-sunshine-cloud-request/health.svg)](https://phpackages.com/packages/rain-sunshine-cloud-request)
```

PHPackages © 2026

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