-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add phpstan error identifiers #118
Conversation
Thanks for addition! 👍 "Method unused" could suggest its an unused private method. Could you add word "public.*" to make it more clear? |
I intentionally chose identifiers that were already known to PHPStan, especially given that they are all semantically matching these rules. I thought that by using existing identifiers, tools which make use of identifiers would work out of the box and would be able to make use of the existing semantics. Adding a then you look at the list of known identifiers you will see that many rules share identifiers already and none of the identifiers make a difference depending on visibility of where the issue is raised. I’m totally willing to make the change and I’m absolutely not in the habit of arguing with maintainers (I am very well aware how busy you are), but I would love to get some insight into the why of your request given the considerations above. |
Using already existing PHPStan identifiers doesn't seem like a good idea. It's like naming a service with same generic like "manager" string, overriding all existing services with same name. Hence the prefix |
force pushed to add the prefix. |
Thank you 🙏 |
* TomasVotruba-main: (21 commits) Delete .github/FUNDING.yml Update FUNDING.yml Update composer.json Keep the code DRY Small improvement Added support for @internal or @public Reduce memory consumption of collectors (TomasVotruba#131) Fix blade regex to discover method call with args (TomasVotruba#128) Fix template discovery, to include root file too (TomasVotruba#127) remove `composer-dependency-analyser.php` from releases (TomasVotruba#126) Bump deps (TomasVotruba#125) Detect public properties used via Subclass (TomasVotruba#123) Fix ClassConstFetchCollector (TomasVotruba#122) Fix union-type handling in PublicStaticPropertyFetchCollector (TomasVotruba#121) Fix union-type handling in PublicPropertyFetchCollector (TomasVotruba#120) add phpstan error identifiers (TomasVotruba#118) Fixed nette/utils indirect dependency (TomasVotruba#116) Added test for JsonSerialize (TomasVotruba#112) Add RelativeUnusedPublicClassMethodRule (TomasVotruba#111) Bump to PHP 8.2 (TomasVotruba#110) ...
* origin/main: (22 commits) Allow phpstan 2 Delete .github/FUNDING.yml Update FUNDING.yml Update composer.json Keep the code DRY Small improvement Added support for @internal or @public Reduce memory consumption of collectors (TomasVotruba#131) Fix blade regex to discover method call with args (TomasVotruba#128) Fix template discovery, to include root file too (TomasVotruba#127) remove `composer-dependency-analyser.php` from releases (TomasVotruba#126) Bump deps (TomasVotruba#125) Detect public properties used via Subclass (TomasVotruba#123) Fix ClassConstFetchCollector (TomasVotruba#122) Fix union-type handling in PublicStaticPropertyFetchCollector (TomasVotruba#121) Fix union-type handling in PublicPropertyFetchCollector (TomasVotruba#120) add phpstan error identifiers (TomasVotruba#118) Fixed nette/utils indirect dependency (TomasVotruba#116) Added test for JsonSerialize (TomasVotruba#112) Add RelativeUnusedPublicClassMethodRule (TomasVotruba#111) ...
For easier handling of ignores, PHPStan 1.11 has added error identifiers.
This PR adds them to the various reports generated by the
unused-public
extension.As far as I can tell, the built-in testing framework for rules doesn't yet support error identifiers and thus I can't really provide test-cases for these. Correct me if I'm wrong and I'll gladly add test-cases.