Skip to content

Commit

Permalink
Fixed bug #2586 : Generic.WhiteSpace.ScopeIndent false positives when…
Browse files Browse the repository at this point in the history
… indenting open tags at a non tab-stop
  • Loading branch information
gsherwood committed Nov 12, 2019
1 parent 64d184e commit adda8bc
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Generic.WhiteSpace.ScopeIndent now supports static arrow functions
- PSR2.ControlStructures.ControlStructureSpacing now checks whitespace before the closing parenthesis of multi-line control structures
-- Previously, it incorrectly applied the whitespace check for single-line definitions only
- Fixed bug #2586 : Generic.WhiteSpace.ScopeIndent false positives when indenting open tags at a non tab-stop
- Fixed bug #2638 : Squiz.CSS.DuplicateClassDefinitionSniff sees comments as part of the class name
-- Thanks to Raphael Horber for the patch
- Fixed bug #2674 : Squiz.Functions.FunctionDeclarationArgumentSpacing prints wrong argument name in error message
Expand Down
2 changes: 0 additions & 2 deletions src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -894,8 +894,6 @@ public function process(File $phpcsFile, $stackPtr)
}
}
}

$checkIndent = (int) (ceil($checkIndent / $this->indent) * $this->indent);
}//end if

// Close tags needs to be indented to exact column positions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,10 @@ $result = array_map(

?>

<?php if (true) : ?>
<span></span>
<?php endif ?>

<?php
if (true) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,10 @@ $result = array_map(

?>

<?php if (true) : ?>
<span></span>
<?php endif ?>

<?php
if (true) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,10 @@ $result = array_map(

?>

<?php if (true) : ?>
<span></span>
<?php endif ?>

<?php
if (true) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,10 @@ $result = array_map(

?>

<?php if (true) : ?>
<span></span>
<?php endif ?>

<?php
if (true) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ public function getErrorList($testFile='ScopeIndentUnitTest.inc')
1340 => 1,
1342 => 1,
1345 => 1,
1445 => 1,
1446 => 1,
1447 => 1,
1448 => 1,
1449 => 1,
1450 => 1,
1451 => 1,
1452 => 1,
];

}//end getErrorList()
Expand Down

0 comments on commit adda8bc

Please sign in to comment.