PHPackages                             szwsuny/asserthelper - 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. szwsuny/asserthelper

ActiveLibrary

szwsuny/asserthelper
====================

oh~~

10PHP

Since Sep 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/szwsuny/AssertHelper)[ Packagist](https://packagist.org/packages/szwsuny/asserthelper)[ RSS](/packages/szwsuny-asserthelper/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

AssertHelper
============

[](#asserthelper)

### 使用方式

[](#使用方式)

#### 1. AssertHelper::valudate($value)-&gt;empty('如果为空的异常信息')-&gt;throws();

[](#1-asserthelpervaludatevalue-empty如果为空的异常信息-throws)

```
//throw Exception

```

#### 2. $result = AssertHelper::validate('1332233122x')-&gt;empty('如果为空的异常信息')-&gt;mobile('手机号格式不正确')-&gt;bool($msg);

[](#2-result--asserthelpervalidate1332233122x-empty如果为空的异常信息-mobile手机号格式不正确-boolmsg)

// $result = false // $msg = '手机号格式不正确'

### 可以使用的

[](#可以使用的)

#### 1.empty 验证空

[](#1empty-验证空)

#### 2.int 验证数字

[](#2int-验证数字)

#### 3.in 验证包含在数组中

[](#3in-验证包含在数组中)

#### 4.mobile 验证手机号

[](#4mobile-验证手机号)

#### 5.length 验证长度

[](#5length-验证长度)

#### 6.mb\_length 验证中文长度

[](#6mb_length-验证中文长度)

#### 7.length\_between 验证长度范围

[](#7length_between-验证长度范围)

#### 8.mb\_length\_between 验证中文长度范围

[](#8mb_length_between-验证中文长度范围)

#### 9.email 验证邮箱

[](#9email-验证邮箱)

#### 10.float 验证小数

[](#10float-验证小数)

#### 11.ip 验证ip

[](#11ip-验证ip)

#### 12.between 验证数字范围

[](#12between-验证数字范围)

#### 13.equal 验证等于的值

[](#13equal-验证等于的值)

#### 14.greater 验证大于的值

[](#14greater-验证大于的值)

#### 15.less 验证小于的值

[](#15less-验证小于的值)

### 结束使用

[](#结束使用)

#### 1.throws throw一个异常

[](#1throws-throw一个异常)

#### 2.bool 返回一个bool值

[](#2bool-返回一个bool值)

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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://avatars.githubusercontent.com/u/27332034?v=4)[孙志伟](/maintainers/szwsuny)[@szwsuny](https://github.com/szwsuny)

---

Top Contributors

[![szwsuny](https://avatars.githubusercontent.com/u/27332034?v=4)](https://github.com/szwsuny "szwsuny (9 commits)")

### Embed Badge

![Health badge](/badges/szwsuny-asserthelper/health.svg)

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

PHPackages © 2026

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