You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PEAR.ControlStructures.MultiLineCondition.Alignment is detected here for the closing brace:
<?php
function bar() {
if ($a
&& $b
) {
echo 'bar';
}
}
But not here (because the loop exits before the closing brace):
<?php
function bar() {
if ($a
&& $b
) {
echo 'bar';
}
}
Unfortunately, the autofixer produces code like the second one when fixing the CloseBracket error here:
<?php
function bar() {
if ($a
&& $b) {
echo 'bar';
}
}
(try this with phpcbf --standard=PEAR --exclude=PEAR.WhiteSpace.ScopeIndent)
The ScopeIndent Sniff fixes the second example if it is enabled, but I think this should be detected and fixed by the MultiLineCondition sniff as well (since it does so if there's at least one space).
The text was updated successfully, but these errors were encountered:
gsherwood
changed the title
PEAR.ControlStructures.MultiLineCondition.Alignment is not detected if closing brace is the first token on the line.
PEAR.ControlStructures.MultiLineCondition.Alignment not detected if closing brace is first token on line
Sep 20, 2016
Uh oh!
There was an error while loading. Please reload this page.
PEAR.ControlStructures.MultiLineCondition.Alignment is detected here for the closing brace:
But not here (because the loop exits before the closing brace):
Unfortunately, the autofixer produces code like the second one when fixing the CloseBracket error here:
(try this with
phpcbf --standard=PEAR --exclude=PEAR.WhiteSpace.ScopeIndent
)The ScopeIndent Sniff fixes the second example if it is enabled, but I think this should be detected and fixed by the MultiLineCondition sniff as well (since it does so if there's at least one space).
The text was updated successfully, but these errors were encountered: