svnldwg / phpstan-rules
Provides additional rules for phpstan/phpstan
Installs: 969
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 2
Forks: 0
Open Issues: 5
Type:phpstan-extension
pkg:composer/svnldwg/phpstan-rules
Requires
- php: ^7.2 | ^8.0
- ext-mbstring: *
- nikic/php-parser: ^4.2.3
- phpstan/phpstan: >=0.11
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16.4
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^8.0 || ^9.0
This package is auto-updated.
Last update: 2025-11-29 03:04:30 UTC
README
Provides additional rules for phpstan/phpstan.
This package is still in development, please report any issues or bugs.
Installation
Run
$ composer require --dev svnldwg/phpstan-rules
Usage
The rules provided are included in rules.neon.
When you are using 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
This package provides the following rules for use with phpstan/phpstan:
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
This package is licensed using the MIT License.
Please have a look at LICENSE.md.