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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ The file documents changes to the PHP_CodeSniffer project.
- Thanks to Juliette Reinders Folmer (@jrfnl) for the patch
- Fixed bug #3877 : Filter names can be case-sensitive. The -h help text will now display the correct case for the available filters
- Thanks to @simonsan for the patch
- Fixed bug #3893 : Generic/DocComment : the SpacingAfterTagGroup fixer could accidentally remove ignore annotations
- Thanks to Juliette Reinders Folmer (@jrfnl) for the patch
- Fixed bug #3906 : Tokenizer/CSS: fixed a bug related to the unsupported slash comment syntax
- Thanks to Dan Wallis (@fredden) for the patch

Expand Down
8 changes: 6 additions & 2 deletions src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\Sniff;
use PHP_CodeSniffer\Util\Tokens;

class DocCommentSniff implements Sniff
{
Expand Down Expand Up @@ -280,9 +281,12 @@ public function process(File $phpcsFile, $stackPtr)
}

// Check that there was single blank line after the tag block
// but account for a multi-line tag comments.
// but account for multi-line tag comments.
$find = Tokens::$phpcsCommentTokens;
$find[T_DOC_COMMENT_TAG] = T_DOC_COMMENT_TAG;

$lastTag = $group[$pos];
$next = $phpcsFile->findNext(T_DOC_COMMENT_TAG, ($lastTag + 3), $commentEnd);
$next = $phpcsFile->findNext($find, ($lastTag + 3), $commentEnd);
if ($next !== false) {
$prev = $phpcsFile->findPrevious([T_DOC_COMMENT_TAG, T_DOC_COMMENT_STRING], ($next - 1), $commentStart);
if ($tokens[$next]['line'] !== ($tokens[$prev]['line'] + 2)) {
Expand Down
10 changes: 10 additions & 0 deletions src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,14 @@
* @link http://pear.php.net/package/PHP_CodeSniffer
*/

/**
* Do something.
*
* @codeCoverageIgnore
*
* @phpcs:disable Stnd.Cat.SniffName
*
* @return void
*/

/** No docblock close tag. Must be last test without new line.
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,14 @@
* @link http://pear.php.net/package/PHP_CodeSniffer
*/

/**
* Do something.
*
* @codeCoverageIgnore
*
* @phpcs:disable Stnd.Cat.SniffName
*
* @return void
*/

/** No docblock close tag. Must be last test without new line.