diff --git a/coder_sniffer/Drupal/Sniffs/Commenting/InlineVariableCommentSniff.php b/coder_sniffer/Drupal/Sniffs/Commenting/InlineVariableCommentSniff.php index fb14ac382e9a966a2f74dd25719434c582d7c73c..814b711d116c32b03e3c662507fd78031bdb374b 100644 --- a/coder_sniffer/Drupal/Sniffs/Commenting/InlineVariableCommentSniff.php +++ b/coder_sniffer/Drupal/Sniffs/Commenting/InlineVariableCommentSniff.php @@ -84,6 +84,9 @@ class InlineVariableCommentSniff implements Sniff $warning = 'Inline @var declarations should use the /** */ delimiters'; if (strpos($tokens[$stackPtr]['content'], '#') === 0 || strpos($tokens[$stackPtr]['content'], '//') === 0) { + // If this comment contains '*/' then the developer is mixing + // inline comment styles. This could be commented out code, + // so leave this line alone completely. if (strpos($tokens[$stackPtr]['content'], '*/') !== false) { return; } @@ -102,7 +105,7 @@ class InlineVariableCommentSniff implements Sniff if ($phpcsFile->addFixableWarning($warning, $stackPtr, 'VarInline') === true) { $phpcsFile->fixer->replaceToken($stackPtr, substr_replace($tokens[$stackPtr]['content'], '/**', 0, 2)); } - } + }//end if }//end if return;