PHPackages                             lswl/sensitive - 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. lswl/sensitive

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

lswl/sensitive
==============

Filter sensitive words based on determination of Finite Automata (DFA) algorithm.

v1.0.0(4y ago)02MITPHPPHP ^7.3|8.0

Since Oct 13Pushed 4y ago1 watchersCompare

[ Source](https://github.com/linshaowl/sensitive)[ Packagist](https://packagist.org/packages/lswl/sensitive)[ Docs](https://linshaowl.com/)[ RSS](/packages/lswl-sensitive/feed)WikiDiscussions 1.0 Synced 1w ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

介绍
--

[](#介绍)

> 基于 lustre/php-dfa-sensitive 添加了默认敏感词库

安装
--

[](#安装)

```
composer require lswl/sensitive
```

使用
--

[](#使用)

```
use Lswl\Sensitive\SensitiveService;

// 实例化服务
$sensitive = new SensitiveService();
// 设置敏感字符串数组
$sensitive->setSensitiveWords([]);
// 设置排除字符串数组
$sensitive->setExceptWords([]);
// 使用敏感词库,默认使用
$sensitive->withSensitiveWordLibrary(true);
// 验证,有敏感词会抛出 Lswl\Sensitive\SensitiveException 异常
$sensitive->validate('这是需要验证的字符串', '错误消息前缀');
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Every ~0 days

Total

2

Last Release

1678d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/406878610be7a05aa8767eb4c0c6158b60e085f191d7d6a201f122bb9ff71043?d=identicon)[lswl](/maintainers/lswl)

---

Top Contributors

[![linshaowl](https://avatars.githubusercontent.com/u/19506950?v=4)](https://github.com/linshaowl "linshaowl (1 commits)")

---

Tags

sensitivedfalswl

### Embed Badge

![Health badge](/badges/lswl-sensitive/health.svg)

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

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)[xemlock/htmlpurifier-html5

HTML5 support for HTML Purifier

1052.9M11](/packages/xemlock-htmlpurifier-html5)

PHPackages © 2026

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