PHPackages                             pereorga/phpstan-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. pereorga/phpstan-rules

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

pereorga/phpstan-rules
======================

Custom PHPStan rules enforcing an opinionated code style.

1.4.0(1mo ago)14.1k↓42.5%MITPHPPHP ^8.1CI passing

Since Apr 11Pushed 1w ago1 watchersCompare

[ Source](https://github.com/pereorga/phpstan-rules)[ Packagist](https://packagist.org/packages/pereorga/phpstan-rules)[ RSS](/packages/pereorga-phpstan-rules/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (7)Dependencies (11)Versions (12)Used By (0)

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

[](#phpstan-rules)

Opinionated rules for [PHPStan](https://github.com/phpstan/phpstan).

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

[](#installation)

Run:

```
composer require --dev pereorga/phpstan-rules
```

Usage
-----

[](#usage)

To enable all [rules](https://github.com/pereorga/phpstan-rules#rules), reference [`rules.neon`](rules.neon) in your `phpstan.neon` file:

```
includes:
    - vendor/pereorga/phpstan-rules/rules.neon
```

To enable only specific rules, include their individual configuration files from the [`rules/`](rules/) directory:

```
includes:
    - vendor/pereorga/phpstan-rules/rules/no-redundant-boolean-comparison.neon
    - vendor/pereorga/phpstan-rules/rules/snake-case-variable.neon
```

Rules
-----

[](#rules)

### `NoRedundantBooleanComparisonRule`

[](#noredundantbooleancomparisonrule)

[`rules/no-redundant-boolean-comparison.neon`](rules/no-redundant-boolean-comparison.neon)

Disallows comparing boolean expressions with `=== true`, `=== false`, `!== true`, or `!== false`. Use the boolean value directly instead.

### `NoNonReferenceParameterAssignmentRule`

[](#nononreferenceparameterassignmentrule)

[`rules/no-non-reference-parameter-assignment.neon`](rules/no-non-reference-parameter-assignment.neon)

Disallows assigning values to parameters that are not passed by reference. Encourages the use of separate working variables.

### `NoSuperfluousPhpDocTypesRule`

[](#nosuperfluousphpdoctypesrule)

[`rules/no-superfluous-phpdoc-types.neon`](rules/no-superfluous-phpdoc-types.neon)

Detects `@param` and `@return` tags that redundantly duplicate type information already present in native type declarations. Encourages using prose descriptions (e.g., "The name parameter specifies...") for simple types, and `@param`/`@return` tags only for complex types (array shapes, generics).

### `SnakeCaseFunctionRule`

[](#snakecasefunctionrule)

[`rules/snake-case-function.neon`](rules/snake-case-function.neon)

Requires all function names to be written in `snake_case`.

### `SnakeCaseParameterRule`

[](#snakecaseparameterrule)

[`rules/snake-case-parameter.neon`](rules/snake-case-parameter.neon)

Requires all parameter names to be written in `snake_case`.

### `SnakeCaseVariableRule`

[](#snakecasevariablerule)

[`rules/snake-case-variable.neon`](rules/snake-case-variable.neon)

Requires all variable names to be written in `snake_case`.

### `PDOFetchModeRule`

[](#pdofetchmoderule)

[`rules/pdo-fetch-mode.neon`](rules/pdo-fetch-mode.neon)

Ensures that `PDOStatement::fetch()` and `PDOStatement::fetchAll()` are always called with an explicit fetch mode.

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance94

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.1% 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 ~57 days

Recently: every ~90 days

Total

8

Last Release

47d ago

PHP version history (3 changes)1.0.0PHP ^8.4

1.0.1PHP ~8.2.0 || ~8.3.0 || ~8.4.0

1.0.3PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c8586ead92ff8e2dc1e87131712626fad3d534ee61e335d3c1ec3d14a5db9cd?d=identicon)[pereorga](/maintainers/pereorga)

---

Top Contributors

[![pereorga](https://avatars.githubusercontent.com/u/919779?v=4)](https://github.com/pereorga "pereorga (39 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (20 commits)")

---

Tags

PHPStanphpstan-rules

###  Code Quality

TestsPHPUnit

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.5k](/packages/larastan-larastan)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79475.7M2.2k](/packages/phpstan-phpstan-symfony)[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.

4853.5M91](/packages/shipmonk-dead-code-detector)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67272.8M1.4k](/packages/phpstan-phpstan-doctrine)[orrison/meliorstan

Provides PHPStan rules for improved code quality by detecting code smells and possible issues. In addition to enforcing particular naming and code style conventions to reduce bike-shedding.

1915.9k5](/packages/orrison-meliorstan)[wp-cli/wp-cli-tests

WP-CLI testing framework

423.1M142](/packages/wp-cli-wp-cli-tests)

PHPackages © 2026

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