[TypeDeclaration] Handle return from array_map() on ReturnTypeFromStrictTypedCallRector#3471
Conversation
…ctTypedCallRector
|
Fixed 🎉 /cc @staabm |
|
All checks have passed 🎉 @TomasVotruba I think it is ready. |
| $currentFunctionLike = $this->betterNodeFinder->findParentType($currentReturn, FunctionLike::class); | ||
| if ($currentFunctionLike !== $node) { |
There was a problem hiding this comment.
I assume the fix for the actual problem is in these lines here.. all other lines changed are only tests and var renames, right?
There was a problem hiding this comment.
yes, rectify commit are auto-committed due to change from contributors
|
thx for fixing it so fast. does this also fix
if so, would be great to have the test-cases added here |
|
I added more fixture:
This rule is for strict typed call, so it will got the actual information from the function call definition. |
I guess it does currently not take phpstan return type extensions into account.. phpstan itself knows more precise types then the ones rector infers here. but I think you are saying that it uses native-type knowledge and therefore it makes sense to me - since this means no return-type-extensions involved. |
|
Thank you 👍 Let's ship it |
|
awesome, thanks to both of you. |
…ictTypedCallRector (#3471) * [TypeDeclration] Handle return from array_map() on ReturnTypeFromStrictTypedCallRector * Fixed 🎉 * [ci-review] Rector Rectify * [ci-review] Rector Rectify * add more test * more fixture * rename fixture --------- Co-authored-by: GitHub Action <actions@github.com>
Fixes rectorphp/rector#7827