https://github.com/swissspidy/phpstan-no-private
PHPStan rules for detecting usage of pseudo-private functions, classes, and methods.
https://github.com/swissspidy/phpstan-no-private
phpstan phpstan-extension
Last synced: 3 months ago
JSON representation
PHPStan rules for detecting usage of pseudo-private functions, classes, and methods.
- Host: GitHub
- URL: https://github.com/swissspidy/phpstan-no-private
- Owner: swissspidy
- License: mit
- Created: 2023-05-13T17:52:17.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-09-01T22:40:44.000Z (9 months ago)
- Last Synced: 2025-09-02T00:21:21.926Z (9 months ago)
- Topics: phpstan, phpstan-extension
- Language: PHP
- Homepage:
- Size: 111 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Detect usage of pseudo-private code elements
[](https://github.com/swissspidy/phpstan-no-private/actions)
[](https://packagist.org/packages/swissspidy/phpstan-no-private)
[](https://packagist.org/packages/swissspidy/phpstan-no-private)
This PHPStan extension emits deprecation warnings on code which uses properties/functions/methods/classes which are annotated as `@access private`.
## Installation
To use this extension, require it in [Composer](https://getcomposer.org/):
```shell
composer require --dev swissspidy/phpstan-no-private
```
If you also install [phpstan/extension-installer](https://github.com/phpstan/extension-installer) then you're all set!
Manual installation
If you don't want to use `phpstan/extension-installer`, include rules.neon in your project's PHPStan config:
```neon
includes:
- vendor/swissspidy/phpstan-no-private/rules.neon
```
## Credits
This project is a fork of the excellent [phpstan/phpstan-deprecation-rules](https://github.com/phpstan/phpstan-deprecation-rules),
which provides rules that detect usage of deprecated classes, methods, properties, constants and traits.