承接 customergauge/password 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

customergauge/password

最新稳定版本:4.0.1

Composer 安装命令:

composer require customergauge/password

包简介

无描述信息

README 文档

README

This library is used to validade the strength of a password. It's composed by a set of Rules that can be used individualy or aggregated by a rule chain.

Installation

composer require customergauge/password

Usage

Single Rule

use Customergauge\Password\Rule\Lowercase; use Customergauge\Password\Exception\InvalidPassword; $validate = new Lowercase; $password = "UPPERCASE"; try { $validate($password); } catch (InvalidPassword $e) { echo $e->getMessage(); } // output: Password should have at least 1 lowercase character(s) but 0 found.

Rule Chain

use Customergauge\Password\Rule\Lowercase; use Customergauge\Password\Rule\Uppercase; use Customergauge\Password\Rule\Length; use Customergauge\Password\RuleChain; use Customergauge\Password\Exception\InvalidPassword; $validate = new RuleChain( new Lowercase(2), new Uppercase(2), new Length(10), new Digit(3) ); $password = "ABcd00efgh"; try { $validate($password); } catch (InvalidPassword $e) { echo $e->getMessage(); } // output: Password should have at least 3 digit character(s) but 2 found.

Persist Rule Chain

Use PersistRuleChain class when you want to continue the execution even if a rule throws an InvalidPassword exception.

use Customergauge\Password\Rule\Lowercase; use Customergauge\Password\Rule\Uppercase; use Customergauge\Password\Rule\Length; use Customergauge\Password\RuleChain; use Customergauge\Password\Exception\InvalidPassword; $validate = new PersistRuleChain( new Lowercase(2), new Uppercase(2), new Length(10), new Digit(3) ); $password = "ABcd00efgh"; if ($validate($password)) { echo "valid"; } else { echo "invalid"; // It is possible to get all exceptions using $validate->exceptions(); } // output: invalid

Contributing

Contributions are always welcome, please have a look at our issues to see if there's something you could help with.

License

Password Strength Library is licensed under LGPLv3 license.

统计信息

  • 总下载量: 13.95k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 10
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固