Permalink
Browse files

Fixed bug #19953 : PSR2 - Spaces before interface name for abstract c…

…lass
  • Loading branch information...
1 parent 4ecd130 commit 69d6b341c8c1ee0e0b742d8d4daef7c9cbf96b73 @gsherwood gsherwood committed Jun 2, 2013
@@ -89,10 +89,19 @@ public function processOpen(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
}
}//end if
- // We'll need the indent of the class/interface keyword for later.
+ // We'll need the indent of the class/interface declaration for later.
$classIndent = 0;
- if (strpos($tokens[($stackPtr - 1)]['content'], $phpcsFile->eolChar) === false) {
- $classIndent = strlen($tokens[($stackPtr - 1)]['content']);
+ for ($i = ($stackPtr - 1); $i > 0; $i--) {
+ if ($tokens[$i]['line'] === $tokens[$stackPtr]['line']) {
+ continue;
+ }
+
+ // We changed lines.
+ if ($tokens[($i + 1)]['code'] === T_WHITESPACE) {
+ $classIndent = strlen($tokens[($i + 1)]['content']);
+ }
+
+ break;
}
$keyword = $stackPtr;
@@ -94,4 +94,10 @@ class MyClass
}
+abstract class Test implements
+ TestInterface1,
+ TestInterface2
+{
+}
+
?>
View
@@ -53,6 +53,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fixed bug #19935 : notify-send reports do not vanish in gnome-shell
-- Thanks to Christian Weiske for the patch
- Fixed bug #19944 : docblock squiz sniff "return void" trips over return in lambda function
+ - Fixed bug #19953 : PSR2 - Spaces before interface name for abstract class
</notes>
<contents>
<dir name="/">

0 comments on commit 69d6b34

Please sign in to comment.