Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function process(File $phpcsFile, $stackPtr)
$openingBrace = $tokens[$stackPtr]['scope_opener'];

// Is the brace on the same line as the class/interface/trait declaration ?
$lastClassLineToken = $phpcsFile->findPrevious(T_STRING, ($openingBrace - 1), $stackPtr);
$lastClassLineToken = $phpcsFile->findPrevious(T_WHITESPACE, ($openingBrace - 1), $stackPtr, true);
$lastClassLine = $tokens[$lastClassLineToken]['line'];
$braceLine = $tokens[$openingBrace]['line'];
$lineDifference = ($braceLine - $lastClassLine);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,13 @@ class A_Class_With_Really_Long_Name_4
{

}

// While this is ok again.
class Test_Class_Bad_G /*some comment*/ {
}

// And this is not.
class Test_Class_Bad_G
/*some comment*/
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,13 @@ class A_Class_With_Really_Long_Name_4


}

// While this is ok again.
class Test_Class_Bad_G /*some comment*/ {
}

// And this is not.
class Test_Class_Bad_G
/*some comment*/ {

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function getErrorList()
47 => 1,
70 => 1,
79 => 1,
90 => 1,
);

}//end getErrorList()
Expand Down