Created
September 5, 2014 12:18
-
-
Save juhasz/ac8fe952a71de2aa6aba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php b/coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php | |
index 61eb55b..030b239 100644 | |
--- a/coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php | |
+++ b/coder_sniffer/Drupal/Sniffs/Commenting/InlineCommentSniff.php | |
@@ -106,7 +106,9 @@ class Drupal_Sniffs_Commenting_InlineCommentSniff implements PHP_CodeSniffer_Sni | |
} | |
// Only error once per comment. | |
- if (substr($tokens[$stackPtr]['content'], 0, 3) === '/**') { | |
+ $dockBlock = substr($tokens[$stackPtr]['content'], 0, 3) === '/**'; | |
+ $varHint = substr($tokens[$stackPtr]['content'], 0, 9) === '/** @var '; | |
+ if ($dockBlock && !$varHint) { | |
$error = 'Inline doc block comments are not allowed; use "// Comment" instead'; | |
$phpcsFile->addError($error, $stackPtr, 'DocBlock'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment