Skip to content

Add failing test case for ReturnArrayClassMethodToYieldRector (removing comments)#2084

Merged
TomasVotruba merged 4 commits intorectorphp:masterfrom
gnutix:ReturnArrayClassMethodToYieldRector/add-testcase
Oct 5, 2019
Merged

Add failing test case for ReturnArrayClassMethodToYieldRector (removing comments)#2084
TomasVotruba merged 4 commits intorectorphp:masterfrom
gnutix:ReturnArrayClassMethodToYieldRector/add-testcase

Conversation

@gnutix
Copy link
Copy Markdown
Contributor

@gnutix gnutix commented Oct 2, 2019

@gnutix
Copy link
Copy Markdown
Contributor Author

gnutix commented Oct 4, 2019

By the way, I was wondering if it wouldn't be better that ReturnArrayClassMethodToYieldRector uses : iterable instead of : \Iterator as the return type ? what do you think ?

EDIT: looking at PhpParser, I'm not sure there's a way to do that though...

@TomasVotruba
Copy link
Copy Markdown
Member

TomasVotruba commented Oct 4, 2019

Iterator is more precise here, as it narrows it to yield

iterable might lead to non-sense code like:

yield 5
return 5

@TomasVotruba
Copy link
Copy Markdown
Member

Care for fix again?

@gnutix
Copy link
Copy Markdown
Contributor Author

gnutix commented Oct 4, 2019

Not in the next 2 weeks, I've used all the hours I could spare. Need to focus on our project 'til I can.

@TomasVotruba
Copy link
Copy Markdown
Member

No troubles 👍

@TomasVotruba TomasVotruba merged commit 345d477 into rectorphp:master Oct 5, 2019
@TomasVotruba TomasVotruba deleted the ReturnArrayClassMethodToYieldRector/add-testcase branch October 5, 2019 08:31
TomasVotruba added a commit that referenced this pull request Apr 16, 2022
rectorphp/rector-src@92c2fc1 [Php74] Handle standalone false on php >=8 feature enabled on TypedPropertyRector (#2084)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants