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()): ?>

+ + +
+ +

o hai!

+ +
+ diff --git a/package.xml b/package.xml index 1dbf71837c..4864705ca2 100644 --- a/package.xml +++ b/package.xml @@ -30,6 +30,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> -- Thanks to Kunal Mehta for the patch - Fixed bug #694 : Long sniff codes can cause PHP warnings in source report when showing error codes - Fixed bug #704 : ScopeIndent can fail when an opening parenthesis is on a line by itself + - Fixed bug #709 : Squiz.Sniffs.Whitespace.ScopeClosingBraceSniff marking indented endif in mixed inline HTML blocks