rectorphp / type-perfect

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

NarrowPublicClassMethodParamTypeRule: Take default value into account #4

Closed staabm closed 2 months ago

staabm commented 3 months ago

even if all calling types provide the same value, when a default value of a different type is used, the rule should not suggest to change the type.

in our case the default value is intentionally not a int, as we could otherwise not differentiate it from external calls.

staabm commented 3 months ago

found a fix

TomasVotruba commented 2 months ago

Thank you :clap: