PHPackages                             korbeil/phpstan-generic-rules - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. korbeil/phpstan-generic-rules

ActivePhpstan-extension[Testing &amp; Quality](/categories/testing)

korbeil/phpstan-generic-rules
=============================

Generic rules extensions for PHPStan

v2.1.0(10mo ago)12978.5k↓33.5%5[2 issues](https://github.com/Korbeil/phpstan-generic-rules/issues)10MITPHPPHP &gt;=7.4CI passing

Since Sep 12Pushed 10mo ago2 watchersCompare

[ Source](https://github.com/Korbeil/phpstan-generic-rules)[ Packagist](https://packagist.org/packages/korbeil/phpstan-generic-rules)[ RSS](/packages/korbeil-phpstan-generic-rules/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (10)Dependencies (3)Versions (13)Used By (10)

phpstan-generic-rules
=====================

[](#phpstan-generic-rules)

Rules list
----------

[](#rules-list)

### Debug rules

[](#debug-rules)

- You should not have `var_dump`, `exit` or `die` function calls
- If you have `symfony/var-dumper`, you should not have `dump` or `die` function calls

### MbString rules

[](#mbstring-rules)

- You should use multibyte string function when it exists

Installation
------------

[](#installation)

We assume that [PHPStan](https://github.com/phpstan/phpstan) is already installed in your project.

To use this extension, require it in [Composer](https://getcomposer.org/):

```
composer require --dev korbeil/phpstan-generic-rules
```

If you also install [phpstan/extension-installer](https://github.com/phpstan/extension-installer) then you're all set!

 Manual installationIf you don't want to use `phpstan/extension-installer`, include phpstan-strict-rules.neon in your project's PHPStan config:

```
includes:
    - vendor/korbeil/phpstan-generic-rules/extension.neon
```

Advanced usage
--------------

[](#advanced-usage)

You can configure this library with parameters:

```
parameters:
    generic_rules:
        never_empty_rule: true # To enable the never empty rule
        debug_rule: false  # To disable the debug rule
        mb_string_rules: false  # To disable the mb_string rule

```

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance51

Moderate activity, may be stable

Popularity46

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 83.3% 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 ~222 days

Recently: every ~359 days

Total

11

Last Release

308d ago

Major Versions

v0.2.4 → v1.0.02021-11-05

v1.0.1 → v2.0.02024-11-25

PHP version history (2 changes)v0.1.0PHP &gt;=7.2

v2.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/944409?v=4)[Baptiste Leduc](/maintainers/Korbeil)[@Korbeil](https://github.com/Korbeil)

---

Top Contributors

[![Korbeil](https://avatars.githubusercontent.com/u/944409?v=4)](https://github.com/Korbeil "Korbeil (40 commits)")[![kissifrot](https://avatars.githubusercontent.com/u/105998?v=4)](https://github.com/kissifrot "kissifrot (3 commits)")[![lyrixx](https://avatars.githubusercontent.com/u/408368?v=4)](https://github.com/lyrixx "lyrixx (2 commits)")[![loevgaard](https://avatars.githubusercontent.com/u/2412177?v=4)](https://github.com/loevgaard "loevgaard (1 commits)")[![maxhelias](https://avatars.githubusercontent.com/u/12966574?v=4)](https://github.com/maxhelias "maxhelias (1 commits)")[![Nek-](https://avatars.githubusercontent.com/u/972456?v=4)](https://github.com/Nek- "Nek- (1 commits)")

### Embed Badge

![Health badge](/badges/korbeil-phpstan-generic-rules/health.svg)

```
[![Health](https://phpackages.com/badges/korbeil-phpstan-generic-rules/health.svg)](https://phpackages.com/packages/korbeil-phpstan-generic-rules)
```

###  Alternatives

[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67475.0M1.6k](/packages/phpstan-phpstan-doctrine)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79378.2M2.5k](/packages/phpstan-phpstan-symfony)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136411.0k14](/packages/rector-rector-src)[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2613.3M489](/packages/ssch-typo3-rector)[shipmonk/dead-code-detector

Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.

5014.2M111](/packages/shipmonk-dead-code-detector)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)

PHPackages © 2026

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