Add failing test fixture for ReturnTypeDeclarationRector
Failing Test for ReturnTypeDeclarationRector
Based on https://getrector.org/demo/a97ca4ba-526f-4d02-8e5c-c13cc7a82171
That's won't work since you define @template T at different class, even on phpstan.org demo
https://phpstan.org/r/01f63b30-cd96-4f8a-b1e7-7afb8550e13a
For @return TypedResponse<string>, iirc, that's seems not supported yet.
Hi @samsonasik, thanks for the reply. For example, in this case, there is a generic type in the return type hint (in this case string). This makes me think that Rector knows the generic type, but ignores it in the first case.
Here is the case where you can see that phpstan knows the exact type. https://phpstan.org/r/0efd6b5f-cb60-41f5-8254-62628915f41d
ReturnTypeDeclarationRector purpose is to not add @return docblock, so the @return won't be added, different new rule for it may be needed.
ReturnTypeDeclarationRectorpurpose is to not add@returndocblock, so the@returnwon't be added, different new rule for it may be needed.
But in this case, @return docblock is added. What is the difference?
That's by AddArrayReturnDocTypeRector see the Applied Rules part.
I see, I will try to implement the new rule using the AddArrayReturnDocTypeRector example.
Closing for lack of feedback last 3 months. Feel free to resend the test and fix to right location :+1: