-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
IF statement with no braces and double catch turned into syntax error by auto-fixer #3345
Comments
Confirmed. A
The problem looks to be in the If curly braces would have been used for the |
Just checked, same problem exists when using function testFinally()
{
if (true)
try {
} catch (\LogicException $e) {
} finally {
}
} |
PR #3347 should fix this. Testing appreciated. |
I tested it in my test repo, it works. Thanks. |
@GPierre-Antoine Thanks for testing! |
When using cbf to clean up following sample code, it turns it
into
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcbf test.php ...
Expected behavior
Either a fatal error and no code modification, or this code :
Versions (please complete the following information):
Here's a full version : https://github.com/GPierre-Antoine/phpcbf-bug
The text was updated successfully, but these errors were encountered: