eboreum/immutable-interface-phpstan-checker
Composer 安装命令:
composer require --dev eboreum/immutable-interface-phpstan-checker
包简介
Check your project's code for adherence to immutability (class implementing Eboreum\ImmutableInterface\ImmutableInterface) using PHPStan (https://phpstan.org/).
README 文档
README

A PHPStan rule, which checks all classes implementing (or interfaces extending) Eboreum\ImmutableInterface\ImmutableInterface (available in the eboreum/immutable-interface package) for adherence to immutability.
This library respects the paths defined in your custom code base's phpstan.neon file.
An alternative
If you do not like the inheritance pattern or if you have specific cases where you do not want inheritance to apply, you may instead use these libraries in combination:
- php-static-analysis/attributes: Defines the
@immutableannotation. - php-static-analysis/phpstan-extension: A
--devpackage, which reacts to the annotations defined in php-static-analysis/attributes (bullet 1).
Requirements
"php": "^8.5",
"eboreum/immutable-interface": "^1.0",
"phpstan/phpstan": "^2.0"
Installation
Via Composer (https://packagist.org/packages/eboreum/immutable-interface-phpstan-checker):
composer require --dev eboreum/immutable-interface-phpstan-checker
Update your local phpstan.neon to load this package as a PHPStan extension:
includes:
- vendor/eboreum/immutable-interface-phpstan-checker/phpstan.neon
Via GitLab:
git clone git@gitlab.com:eboreum/immutable-interface-phpstan-checker.git
License & Disclaimer
See LICENSE file. Basically: Use this library at your own risk.
Acknowledgements
ChatGPT and GitHub Copilot were used to implement parts of this code base. However, this project is not entirely vibe coded. Everything has been inspected and sometimes rewritten by human eyes and brains.
Contributing
We prefer that you create an issue and or a merge request at https://gitlab.com/eboreum/immutable-interface-phpstan-checker, and have a discussion about a feature or bug here.
Credits
Authors
- Kasper Søfren (kafoso)
E-mail: soefritz@gmail.com
Homepage: https://gitlab.com/kafoso / https://github.com/kafoso
AI Disclaimer
Parts of this code base has been made using AI, namely GPT-5.5! Although, there was an adult in the room during this process.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-24