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

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

svnldwg/phpstan-rules
=====================

Provides additional rules for phpstan/phpstan

v0.2.4(5y ago)7978[3 issues](https://github.com/svnldwg/phpstan-rules/issues)[2 PRs](https://github.com/svnldwg/phpstan-rules/pulls)MITPHPPHP ^7.2 | ^8.0

Since Oct 21Pushed 3y ago2 watchersCompare

[ Source](https://github.com/svnldwg/phpstan-rules)[ Packagist](https://packagist.org/packages/svnldwg/phpstan-rules)[ Docs](https://github.com/svnldwg/phpstan-rules)[ RSS](/packages/svnldwg-phpstan-rules/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (5)Versions (11)Used By (0)

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

[](#phpstan-rules)

Provides additional rules for [`phpstan/phpstan`](https://github.com/phpstan/phpstan).

This package is still in development, please report any issues or bugs.

[![CI Status](https://github.com/svnldwg/phpstan-rules/workflows/Tests%20&%20Code%20Check/badge.svg)](https://github.com/svnldwg/phpstan-rules/workflows/Tests%20&%20Code%20Check/badge.svg)[![GitHub last commit](https://camo.githubusercontent.com/2fa84d73432973017ca6b0e58bfa9dc223ff639a3baa2df611bb7ba29212b01d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f73766e6c6477672f7068707374616e2d72756c6573)](https://camo.githubusercontent.com/2fa84d73432973017ca6b0e58bfa9dc223ff639a3baa2df611bb7ba29212b01d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f73766e6c6477672f7068707374616e2d72756c6573)[![PHPStan](https://camo.githubusercontent.com/f3eb7f82e8aff9545215cf56332a4d7b84b6ef2287b84e61d02473f67e1f1aef/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c253230382d627269676874677265656e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/f3eb7f82e8aff9545215cf56332a4d7b84b6ef2287b84e61d02473f67e1f1aef/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c253230382d627269676874677265656e2e7376673f7374796c653d666c6174)[![PHP Versions](https://camo.githubusercontent.com/4c62148864d567c4ee794ffab09c1dd4a3f45e41064bbb016440beddaae71a4d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e322d3838393242462e737667)](https://camo.githubusercontent.com/4c62148864d567c4ee794ffab09c1dd4a3f45e41064bbb016440beddaae71a4d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e322d3838393242462e737667)[![Downloads](https://camo.githubusercontent.com/24e20ea34e6e16332838a9ba8fdac40cfd2c173a8d804cae97dde73576415a40/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73766e6c6477672f7068707374616e2d72756c65732e7376673f7631)](https://packagist.org/packages/svnldwg/phpstan-rules)

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

[](#installation)

Run

```
$ composer require --dev svnldwg/phpstan-rules
```

Usage
-----

[](#usage)

The [rules](https://github.com/svnldwg/phpstan-rules#rules) provided are included in [`rules.neon`](rules.neon).

When you are using [`phpstan/extension-installer`](https://github.com/phpstan/extension-installer), `rules.neon` will be automatically included.

Otherwise you need to include `rules.neon` in your `phpstan.neon`:

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

Rules
-----

[](#rules)

This package provides the following rules for use with [`phpstan/phpstan`](https://github.com/phpstan/phpstan):

### `ImmutableObjectRule`

[](#immutableobjectrule)

This rule reports an error when a class or class property tagged as immutable is mutable. This can be used for example to ensure that value objects are always immutable.

💡 Classes or properties can be tagged as immutable by adding the annotation `@psalm-immutable` or `@immutable` to the phpdoc.

💡 The immutability rule also asserts that immutable properties are not mutated in child classes

License
-------

[](#license)

This package is licensed using the MIT License.

Please have a look at [`LICENSE.md`](LICENSE.md).

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance11

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.4% 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 ~13 days

Recently: every ~22 days

Total

8

Last Release

1984d ago

Major Versions

0.2.3 → 7.x-dev2020-11-10

PHP version history (2 changes)v0.1PHP ^7.2

v0.2.4PHP ^7.2 | ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6998fc4404681b53f187535d3e53ce302f65499c67cf1651ec32e582c4542e7c?d=identicon)[svnldwg](/maintainers/svnldwg)

---

Top Contributors

[![svnldwg](https://avatars.githubusercontent.com/u/37910952?v=4)](https://github.com/svnldwg "svnldwg (28 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")

---

Tags

PHPStanphpstan-rules

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[larastan/larastan

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

6.5k55.4M8.3k](/packages/larastan-larastan)[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)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136406.3k14](/packages/rector-rector-src)[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)[voku/phpstan-rules

Provides additional rules for phpstan/phpstan.

3396.0k8](/packages/voku-phpstan-rules)[sidz/phpstan-rules

Set of PHPStan rules

31507.9k21](/packages/sidz-phpstan-rules)

PHPackages © 2026

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