Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Oct 19, 2025

No description provided.

@staabm staabm marked this pull request as ready for review October 19, 2025 17:48
@staabm staabm changed the title YieldDataProviderRector: Added failling test [CodeQuality] Skip with if on YieldDataProviderRector with yield from and return Oct 19, 2025
@staabm
Copy link
Contributor Author

staabm commented Oct 19, 2025

@samsonasik please see another case of the same problem as in #556

Comment on lines +16 to +20
yield from [
['value3', 'value4'],
['value5', 'value6'],
['value7', 'value8'],
];
Copy link
Member

@samsonasik samsonasik Oct 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add test to allow multiple yield from ? see https://3v4l.org/seVoc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add it, but the current rector impl will not work with it ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or should I add a test, that this scenario will be skipped?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think we can fix with if yield form is multiple, just skip. findInstanceof() and count() > 1 should works.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Member

@samsonasik samsonasik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's give it a try 👍

@samsonasik samsonasik merged commit 8c66667 into rectorphp:main Oct 19, 2025
6 checks passed
@staabm staabm deleted the fail2 branch October 19, 2025 19:17
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