The following error was recorded under Squiz.WhiteSpace.ControlStructureSpacing.NoLineAfterClose
449 | ERROR | [x] No blank line found after control structure (Squiz.WhiteSpace.ControlStructureSpacing.NoLineAfterClose)
The code is a try/catch/finally block with a set of if control structures inside the catch.
link to code section: https://github.com/joomla-framework/console/blob/13a8498930831b88c5ece0327a1c46e331a54fb8/src/Application.php#L390-L466
The error occurs at the catch close bracket before the finally keyword
I believe the Expected result is no error for this code
Yes, it should be no error. I also found a couple of other sniffs that were not checking finally blocks, so I've fixed those up as well. Thanks for reporting this.
You are welcome. Thank you for addressing this issue.
One question, Will this be backported to 2.9.x?
Should I backport it and submit a PR?
One question, Will this be backported to 2.9.x?
I'm not maintaining the 2.9 branch any more, so it wont be backported.
But, I still need to tag and release the very final 2.9 version, so if you want to create a PR for this, I'll merge it into 2.9 before I do that. But once that's done, I wont be able to fix any more 2.9 issues and you may need to maintain a fork if you want to backport any more.
This change (based on bisect) introduces a BC break in 3.2.3 bugfix release.
The following code did not produce any error in 3.2.2:
<?php
try {
doSomething();
} catch (SomeException $e) {
// ignore
}
It is now producing the following error in 3.2.3:
FILE: test.php
------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
6 | ERROR | Empty CATCH statement detected (Generic.CodeAnalysis.EmptyStatement.DetectedCatch)
------------------------------------------------------------------------------------------------