Skip to content
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

RemoveUselessReturnTagRector should not remove if iterable type is specified #5674

Closed
OskarStark opened this issue Feb 25, 2021 · 0 comments · Fixed by #5675
Closed

RemoveUselessReturnTagRector should not remove if iterable type is specified #5674

OskarStark opened this issue Feb 25, 2021 · 0 comments · Fixed by #5675
Labels

Comments

@OskarStark
Copy link
Contributor

OskarStark commented Feb 25, 2021

Bug Report

Subject Details
Rector version e.g. v0.9.31 (invoke vendor/bin/rector --version)
Installed as prefixed Rector

In my example this should not be removed:

https://getrector.org/demo/03643045-9933-4fce-9a70-3c948e737c5a

Produced diff:

@@ -2,11 +2,8 @@
 
 final class DemoFile
 {
-    /**
-     * @return iterable<stdClass>
-     */
     public function run(): iterable
     {
         yield \stdClass;
     }
 }

If you remove, PHPStan is complaining, if I add, rector removes it 😄

Method App\ArgumentResolver\UserIdArgumentResolver::resolve() return type has no value type specified in
iterable type iterable.
💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

@OskarStark OskarStark added the bug label Feb 25, 2021
@OskarStark OskarStark changed the title RemoveUselessReturnTagRector should not remove if utterable type is specified RemoveUselessReturnTagRector should not remove if iterable type is specified Feb 25, 2021
TomasVotruba added a commit that referenced this issue Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant