-
-
Notifications
You must be signed in to change notification settings - Fork 671
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
return type not inferred #8181
Comments
PHPStan seems detect variable |
@staabm I created PHPStan issue at phpstan/phpstan#9855 |
Thx. Seems its a autoloading issue then. I need to check class loading rules. But I still got an idea from this conversation. Maybe we can have a rector which replaces the variable return with a constant value return when phpstan is able to narrow the variable type to a single constant value? |
I discussed with Ondre, it seems the type when class and method exists, it got ConstantStringType, that may need to be checked. |
Feature Request
https://getrector.com/demo/905228f9-7d32-4aa3-9895-7071b3d6ff83
I wonder why rector is not able to infer the
string
return typeThe text was updated successfully, but these errors were encountered: