Skip to content
Snippets Groups Projects
Unverified Commit 5db17e37 authored by Klaus Purer's avatar Klaus Purer Committed by GitHub
Browse files

fix(DocComment): Allow phpcs ignore comments before a tag (#3523506)

parent 92557b90
No related branches found
No related tags found
No related merge requests found
......@@ -370,6 +370,7 @@ class DocCommentSniff implements Sniff
if ($tokens[$firstTag]['line'] !== ($tokens[$prev]['line'] + 2)
&& isset($fileShort) === false
&& in_array($tokens[$firstTag]['content'], ['@code', '@link', '@endlink']) === false
&& isset(Tokens::$phpcsCommentTokens[$tokens[$prev]['code']]) === false
) {
$error = 'There must be exactly one blank line before the tags in a doc comment';
$fix = $phpcsFile->addFixableError($error, $firstTag, 'SpacingBeforeTags');
......
......@@ -1986,3 +1986,20 @@ class TestPlugin {
}
}
/**
* Provides a collection of condition plugins.
*/
class ConditionPluginCollection extends DefaultLazyPluginCollection {
/**
* {@inheritdoc}
*
* phpcs:ignore Drupal.Commenting.FunctionComment.MissingReturnComment
* @return \Drupal\Core\Condition\ConditionInterface
*/
public function &get($instance_id) {
return 'x';
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment