Skip to content

Commit

Permalink
Merge pull request #18 from webimpress/hotfix/doc-block-empty-line-be…
Browse files Browse the repository at this point in the history
…tween

DocComment sniff - allow empty line between two doc-blocks
  • Loading branch information
michalbundyra committed May 14, 2019
2 parents 65ceb28 + afbd9d9 commit 50dfa94
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ private function checkAfterClose(File $phpcsFile, int $commentStart, int $commen
$allowEmptyLineBefore = [
T_NAMESPACE,
T_USE,
T_DOC_COMMENT_OPEN_TAG,
];

$prev = $phpcsFile->findPrevious(T_WHITESPACE, $commentStart - 1, null, true);
Expand Down
11 changes: 11 additions & 0 deletions test/Sniffs/Commenting/DocCommentUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,15 @@ class Foo
}
);
}

/**
* FIRST DOC-BLOCK COMMENT
*/

/**
* Method doc-block
*/
public function allowSpaceBetweenTwoPhpDocBlock()
{
}
}
11 changes: 11 additions & 0 deletions test/Sniffs/Commenting/DocCommentUnitTest.inc.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,15 @@ $c = 'xyz';
}
);
}

/**
* FIRST DOC-BLOCK COMMENT
*/

/**
* Method doc-block
*/
public function allowSpaceBetweenTwoPhpDocBlock()
{
}
}

0 comments on commit 50dfa94

Please sign in to comment.