Skip to content

more reliable way getting last stmt#2605

Merged
TomasVotruba merged 2 commits intorectorphp:masterfrom
Jaapze:remove-dead-return-rector-improvement
Jan 8, 2020
Merged

more reliable way getting last stmt#2605
TomasVotruba merged 2 commits intorectorphp:masterfrom
Jaapze:remove-dead-return-rector-improvement

Conversation

@Jaapze
Copy link
Copy Markdown
Contributor

@Jaapze Jaapze commented Jan 8, 2020

This is a more reliable way of getting the last array element (preserving the internal pointer), especially when the keys of the stmt gets scrambled by unsetting items.

This is a more reliable way of getting the last array element, especially when certain keys are reset of the stmt array.
Comment thread packages/DeadCode/src/Rector/FunctionLike/RemoveDeadReturnRector.php Outdated
@TomasVotruba TomasVotruba self-requested a review January 8, 2020 12:38
@TomasVotruba TomasVotruba merged commit f5e3537 into rectorphp:master Jan 8, 2020
@Jaapze Jaapze deleted the remove-dead-return-rector-improvement branch January 10, 2020 12:16
TomasVotruba added a commit that referenced this pull request Jul 1, 2022
TomasVotruba added a commit that referenced this pull request Jul 2, 2022
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