Skip to content

[Cleanup] Deprecate ChangeAndIfToEarlyReturnRector as creates less readable code with inverted conditions#6041

Merged
TomasVotruba merged 3 commits intomainfrom
tv-change-detection
Jun 26, 2024
Merged

[Cleanup] Deprecate ChangeAndIfToEarlyReturnRector as creates less readable code with inverted conditions#6041
TomasVotruba merged 3 commits intomainfrom
tv-change-detection

Conversation

@TomasVotruba
Copy link
Copy Markdown
Member

@TomasVotruba TomasVotruba commented Jun 26, 2024

I recall making this rule at early years of Rector, to showcase what Rector can do. Looking at it now, it makes code quite hard to read and removes the original point of single line check.

The rest of early-return give code more readbility 👍 , so this one is an odd one :)
Time to deprecate.

@TomasVotruba TomasVotruba changed the title tv change detection [EarlyReturn] Deprecate ChangeAndIfToEarlyReturnRector as creates less readable code with inverted conditions Jun 26, 2024
@TomasVotruba TomasVotruba force-pushed the tv-change-detection branch 2 times, most recently from 5afe681 to 48bb99d Compare June 26, 2024 09:03
@TomasVotruba TomasVotruba force-pushed the tv-change-detection branch from 48bb99d to 4e01d3b Compare June 26, 2024 09:03
@TomasVotruba TomasVotruba changed the title [EarlyReturn] Deprecate ChangeAndIfToEarlyReturnRector as creates less readable code with inverted conditions [Cleanup] Deprecate ChangeAndIfToEarlyReturnRector as creates less readable code with inverted conditions Jun 26, 2024
@TomasVotruba TomasVotruba merged commit d68e8fa into main Jun 26, 2024
@TomasVotruba TomasVotruba deleted the tv-change-detection branch June 26, 2024 09:07
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.

1 participant