diff --git a/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php b/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php index cdf817e8fb..29c5ae4e13 100644 --- a/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php +++ b/src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php @@ -180,7 +180,7 @@ public function checkAlignment($phpcsFile, $stackPtr) $assignColumn = ($varEnd + 1); } else { $padding = ($assignments[$prevAssign]['assign_col'] - $varEnd + $assignments[$prevAssign]['assign_len'] - $assignLen); - if ($padding === 0) { + if ($padding <= 0) { $padding = 1; } diff --git a/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js b/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js index c55cdcedec..3fbb5c512d 100644 --- a/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js +++ b/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js @@ -108,3 +108,8 @@ function() { if (condition) foo = .4 } + +x = x << y; +x <<= y; +x = x >> y; +x >>= y; diff --git a/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js.fixed b/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js.fixed index 36740be48b..f440dfe97d 100644 --- a/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js.fixed +++ b/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.js.fixed @@ -108,3 +108,8 @@ function() { if (condition) foo = .4 } + +x = x << y; +x <<= y; +x = x >> y; +x >>= y; diff --git a/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php b/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php index 1804960241..547e78a4c3 100644 --- a/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php +++ b/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php @@ -107,6 +107,9 @@ public function getWarningList($testFile='MultipleStatementAlignmentUnitTest.inc 85 => 1, 86 => 1, 100 => 1, + 112 => 1, + 113 => 1, + 114 => 1, ]; break; default: