Skip to content

Commit 9b6260b

Browse files
committed
Merge branch 'master' into 3.0
2 parents 52e9332 + 2a6c145 commit 9b6260b

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function process(File $phpcsFile, $stackPtr)
152152
$fix = $phpcsFile->addFixableError($error, $scopeEnd, 'BreakIndent', $data);
153153
}
154154
} else {
155-
$expectedIndent = ($startColumn - 1);
155+
$expectedIndent = max(0, ($startColumn - 1));
156156
if ($braceIndent !== $expectedIndent) {
157157
$error = 'Closing brace indented incorrectly; expected %s spaces, found %s';
158158
$data = array(

src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,7 @@ switch ( $a ) {
140140
}
141141
return 5;
142142
}
143+
144+
?>
145+
<?php $_cartQty = $this->getSummaryCount(); ?>
146+
<div id="minicart" <?php if ($_cartQty == 0): ?>class="empty"<?php endif; ?>>

src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc.fixed

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,8 @@ switch ( $a ) {
143143
}
144144
return 5;
145145
}
146+
147+
?>
148+
<?php $_cartQty = $this->getSummaryCount(); ?>
149+
<div id="minicart" <?php if ($_cartQty == 0): ?>class="empty"<?php
150+
endif; ?>>

src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public function getErrorList()
3939
127 => 1,
4040
135 => 1,
4141
141 => 1,
42+
146 => 1,
4243
);
4344

4445
}//end getErrorList()

0 commit comments

Comments
 (0)