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

Add new UnwrapFinally mutator #1740

Merged
merged 1 commit into from
Oct 18, 2022
Merged

Add new UnwrapFinally mutator #1740

merged 1 commit into from
Oct 18, 2022

Conversation

sidz
Copy link
Member

@sidz sidz commented Oct 16, 2022

This PR:

Mutates:

$check = true;
- try {
-     $callback();
- }
- } finally {
-     $check = false;
- }
+ $callback();
+ $check = false

or

$check = true;
try {
    $callback();
} catch (\Throwable $e) {
    throw $e;
}
- } finally {
-     $check = false;
- }
+ $check = false

@sidz sidz added the Mutator label Oct 16, 2022
@sidz sidz force-pushed the add-try-finally-unwrap-mutator branch 2 times, most recently from 7abb3ff to 4fcf272 Compare October 16, 2022 19:10
@sidz sidz force-pushed the add-try-finally-unwrap-mutator branch from 4fcf272 to bd9e7cf Compare October 16, 2022 19:19
@maks-rafalko maks-rafalko linked an issue Oct 16, 2022 that may be closed by this pull request
Copy link
Member

@maks-rafalko maks-rafalko left a comment

Choose a reason for hiding this comment

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

👌

please update the docs as well

@sidz
Copy link
Member Author

sidz commented Oct 17, 2022

Done

@sidz sidz merged commit c080552 into master Oct 18, 2022
@sidz sidz deleted the add-try-finally-unwrap-mutator branch October 18, 2022 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: Unwrap finally mutator
2 participants