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

Filter by extension

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 @@ -149,6 +149,12 @@ public function process(File $phpcsFile, $stackPtr)

// Allow for comments on the same line as the closer.
for ($nextLineToken = ($closer + 1); $nextLineToken < $phpcsFile->numTokens; $nextLineToken++) {
// A doc comment belongs to the next statement and must not be on
// this line.
if ($tokens[$nextLineToken]['code'] === T_DOC_COMMENT_OPEN_TAG) {
break;
}

if ($tokens[$nextLineToken]['line'] !== $tokens[$closer]['line']) {
break;
}
Expand Down
11 changes: 11 additions & 0 deletions src/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.1.inc
Original file line number Diff line number Diff line change
Expand Up @@ -582,3 +582,14 @@ echo 'this line belongs with the #3904 test';

function Foo() {} function bar($name){}
echo 'this line belongs with the #3904 test';


/**
* foo.
*/
function a() {
}/**
* foo.
*/
function b() {
}
Original file line number Diff line number Diff line change
Expand Up @@ -671,3 +671,17 @@ function Foo() {} function bar($name){}


echo 'this line belongs with the #3904 test';


/**
* foo.
*/
function a() {
}


/**
* foo.
*/
function b() {
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public function getErrorList($testFile='')
566 => 1,
580 => 2,
583 => 3,
591 => 1,
];

case 'FunctionSpacingUnitTest.2.inc':
Expand Down
Loading