diff --git a/coder_sniffer/Drupal/Sniffs/Commenting/DocCommentAlignmentSniff.php b/coder_sniffer/Drupal/Sniffs/Commenting/DocCommentAlignmentSniff.php index a2ddaf8d0ec25d6856627ca8dbb9d0ddce766b88..c6ccc6e4f9ca6147c2ae91ec1ee4545180768440 100644 --- a/coder_sniffer/Drupal/Sniffs/Commenting/DocCommentAlignmentSniff.php +++ b/coder_sniffer/Drupal/Sniffs/Commenting/DocCommentAlignmentSniff.php @@ -137,9 +137,10 @@ class DocCommentAlignmentSniff implements Sniff } } else if ($tokens[($i + 2)]['code'] === T_DOC_COMMENT_TAG && $tokens[($i + 1)]['content'] !== ' ' - // Special @code/@endcode tags can have more than 1 space. + // Special @code/@endcode/@see tags can have more than 1 space. && $tokens[($i + 2)]['content'] !== '@code' && $tokens[($i + 2)]['content'] !== '@endcode' + && $tokens[($i + 2)]['content'] !== '@see' ) { $error = 'Expected 1 space after asterisk; %s found'; $data = [strlen($tokens[($i + 1)]['content'])]; diff --git a/coder_sniffer/Drupal/Sniffs/Commenting/DocCommentSniff.php b/coder_sniffer/Drupal/Sniffs/Commenting/DocCommentSniff.php index c0c572df671eb49eb51b01e1891f099cd4ef468a..4e96145c3d3415ac9dc4038e40790c7e0c84c27d 100644 --- a/coder_sniffer/Drupal/Sniffs/Commenting/DocCommentSniff.php +++ b/coder_sniffer/Drupal/Sniffs/Commenting/DocCommentSniff.php @@ -378,6 +378,7 @@ class DocCommentSniff implements Sniff $ignoreTags = [ '@code', '@endcode', + '@see', ]; foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) { if ($pos > 0) { diff --git a/coder_sniffer/Drupal/Test/Commenting/DocCommentAlignmentUnitTest.inc b/coder_sniffer/Drupal/Test/Commenting/DocCommentAlignmentUnitTest.inc index 2b2c2e672fe2913eae42e3dd5407c1b541a39158..7793532144d6433f33cca7ccd1cef8e77843bc0e 100644 --- a/coder_sniffer/Drupal/Test/Commenting/DocCommentAlignmentUnitTest.inc +++ b/coder_sniffer/Drupal/Test/Commenting/DocCommentAlignmentUnitTest.inc @@ -16,3 +16,14 @@ class Test { var $varStyle; } + +/** + * Short description. + * + * @param string $a + * The following reference is allowed to be indented. + * @see my_function() + */ +function test31($a) { + +} diff --git a/coder_sniffer/Drupal/Test/Commenting/DocCommentAlignmentUnitTest.inc.fixed b/coder_sniffer/Drupal/Test/Commenting/DocCommentAlignmentUnitTest.inc.fixed index 5cce8f7ffb1c966d741af53646f6369951d752d1..36140ef65c731df4ed518e23cd607fd9edaaa2b3 100644 --- a/coder_sniffer/Drupal/Test/Commenting/DocCommentAlignmentUnitTest.inc.fixed +++ b/coder_sniffer/Drupal/Test/Commenting/DocCommentAlignmentUnitTest.inc.fixed @@ -16,3 +16,14 @@ class Test { public $varStyle; } + +/** + * Short description. + * + * @param string $a + * The following reference is allowed to be indented. + * @see my_function() + */ +function test31($a) { + +}