Skip to content

Commit adda8bc

Browse files
committed
Fixed bug #2586 : Generic.WhiteSpace.ScopeIndent false positives when indenting open tags at a non tab-stop
1 parent 64d184e commit adda8bc

File tree

7 files changed

+21
-6
lines changed

7 files changed

+21
-6
lines changed

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
3939
- Generic.WhiteSpace.ScopeIndent now supports static arrow functions
4040
- PSR2.ControlStructures.ControlStructureSpacing now checks whitespace before the closing parenthesis of multi-line control structures
4141
-- Previously, it incorrectly applied the whitespace check for single-line definitions only
42+
- Fixed bug #2586 : Generic.WhiteSpace.ScopeIndent false positives when indenting open tags at a non tab-stop
4243
- Fixed bug #2638 : Squiz.CSS.DuplicateClassDefinitionSniff sees comments as part of the class name
4344
-- Thanks to Raphael Horber for the patch
4445
- Fixed bug #2674 : Squiz.Functions.FunctionDeclarationArgumentSpacing prints wrong argument name in error message

src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -894,8 +894,6 @@ public function process(File $phpcsFile, $stackPtr)
894894
}
895895
}
896896
}
897-
898-
$checkIndent = (int) (ceil($checkIndent / $this->indent) * $this->indent);
899897
}//end if
900898

901899
// Close tags needs to be indented to exact column positions.

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,10 @@ $result = array_map(
14411441

14421442
?>
14431443

1444+
<?php if (true) : ?>
1445+
<span></span>
1446+
<?php endif ?>
1447+
14441448
<?php
14451449
if (true) {
14461450
}

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.inc.fixed

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,10 @@ $result = array_map(
14411441

14421442
?>
14431443

1444+
<?php if (true) : ?>
1445+
<span></span>
1446+
<?php endif ?>
1447+
14441448
<?php
14451449
if (true) {
14461450
}

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,10 @@ $result = array_map(
14411441

14421442
?>
14431443

1444+
<?php if (true) : ?>
1445+
<span></span>
1446+
<?php endif ?>
1447+
14441448
<?php
14451449
if (true) {
14461450
}

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.2.inc.fixed

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,10 @@ $result = array_map(
14411441

14421442
?>
14431443

1444+
<?php if (true) : ?>
1445+
<span></span>
1446+
<?php endif ?>
1447+
14441448
<?php
14451449
if (true) {
14461450
}

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ public function getErrorList($testFile='ScopeIndentUnitTest.inc')
178178
1340 => 1,
179179
1342 => 1,
180180
1345 => 1,
181-
1445 => 1,
182-
1446 => 1,
183-
1447 => 1,
184-
1448 => 1,
181+
1449 => 1,
182+
1450 => 1,
183+
1451 => 1,
184+
1452 => 1,
185185
];
186186

187187
}//end getErrorList()

0 commit comments

Comments
 (0)