diff --git a/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php b/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php index a40cc4f4cc..2dc188b425 100644 --- a/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php +++ b/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php @@ -73,7 +73,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $scopeEnd = $tokens[$stackPtr]['scope_closer']; // Check that the closing brace is on it's own line. - $lastContent = $phpcsFile->findPrevious(array(T_WHITESPACE, T_OPEN_TAG), ($scopeEnd - 1), $scopeStart, true); + $lastContent = $phpcsFile->findPrevious(array(T_INLINE_HTML, T_WHITESPACE, T_OPEN_TAG), ($scopeEnd - 1), $scopeStart, true); if ($tokens[$lastContent]['line'] === $tokens[$scopeEnd]['line']) { $error = 'Closing brace must be on a line by itself'; $fix = $phpcsFile->addFixableError($error, $scopeEnd, 'ContentBefore'); diff --git a/CodeSniffer/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc b/CodeSniffer/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc index bcf0cffc45..8c798c7560 100644 --- a/CodeSniffer/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc +++ b/CodeSniffer/Standards/Squiz/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc @@ -65,3 +65,11 @@ switch ($blah) { getRow()): ?>
= $val ?>
+ + +