rectorphp / type-perfect

Next level type declaration check PHPStan rules
https://getrector.com/blog/introducing-type-perfect-for-extra-safety
MIT License
71 stars 3 forks source link

NarrowPublicClassMethodParamTypeRule: error message too generic #35

Open staabm opened 1 month ago

staabm commented 1 month ago

in some situations we get errors like

Parameters should have "float" types as the only types passed to this method

working with these errors after they got baselined is pretty hard, as the error message does not contain enough context.

suggestions

scollovati commented 1 month ago

The error message should report the parameter(s) name that should be removed. As of now it reports something like Parameters should have "string" types as the only types passed to this method when the second argument can be removed since it is unused.