Commit 4337ddf5 authored by Klaus Purer's avatar Klaus Purer
Browse files

fix(DocCommentAlignment): Allow @see references to be indented under @param docs (#3073750)

parent 284b5186
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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'])];
+1 −0
Original line number Diff line number Diff line
@@ -378,6 +378,7 @@ class DocCommentSniff implements Sniff
        $ignoreTags   = [
            '@code',
            '@endcode',
            '@see',
        ];
        foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) {
            if ($pos > 0) {
+11 −0
Original line number Diff line number Diff line
@@ -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) {

}
+11 −0
Original line number Diff line number Diff line
@@ -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) {

}