PHPackages                             customergauge/password - 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. customergauge/password

ActiveLibrary

customergauge/password
======================

4.0.1(11mo ago)414.8k↓40%LGPL-3.0-or-laterPHPPHP &gt;=8.2CI passing

Since Jun 6Pushed 11mo ago10 watchersCompare

[ Source](https://github.com/cgauge/password-strength-lib)[ Packagist](https://packagist.org/packages/customergauge/password)[ RSS](/packages/customergauge-password/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (8)Used By (0)

Password Strength Library 🔒
===========================

[](#password-strength-library-)

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
============

[](#installation)

```
composer require customergauge/password
```

Usage
=====

[](#usage)

Single Rule
-----------

[](#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
----------

[](#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
------------------

[](#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
============

[](#contributing)

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

License
=======

[](#license)

Password Strength Library is licensed under LGPLv3 license.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance52

Moderate activity, may be stable

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 88.9% 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 ~367 days

Recently: every ~544 days

Total

7

Last Release

335d ago

Major Versions

1.1.1 → 2.0.02019-08-01

2.0.0 → 3.0.02020-12-10

3.0.0 → 4.0.02020-12-22

PHP version history (3 changes)1.0.0PHP ^7.2

4.0.0PHP &gt;=7.4

4.0.1PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/219340?v=4)[Abe](/maintainers/abdala)[@abdala](https://github.com/abdala)

---

Top Contributors

[![abdala](https://avatars.githubusercontent.com/u/219340?v=4)](https://github.com/abdala "abdala (24 commits)")[![fantazista](https://avatars.githubusercontent.com/u/2095755?v=4)](https://github.com/fantazista "fantazista (2 commits)")[![alustau](https://avatars.githubusercontent.com/u/2944692?v=4)](https://github.com/alustau "alustau (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/customergauge-password/health.svg)

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

PHPackages © 2026

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