We've recently added the InlineVariableComment rule, which attempts to fix all inline @var comments which aren't using the /** */ delimiters. This currently results in broken PHP code when the /** */ delimiters are contained within a comment, as it will attempt to add a doc comment within a doc comment, for example:

// /** @var \Drupal\node\NodeInterface $node */

Will result in:

/** /** @var \Drupal\node\NodeInterface $node */ */

We should probably just ignore the @var comments when they're contained within another comment, as it will most likely just be a commented piece of code.

Comments

Arkener created an issue. See original summary.

arkener’s picture

Status: Active » Needs review
klausi’s picture

Assigned: Unassigned » klausi

Thanks, I will add the comment and push this.

  • Arkener authored 525a2b7 on 8.x-3.x
    fix(InlineVariableComment): Ignore commented @var doc comments to fix...
  • klausi committed 67c1bcf on 8.x-3.x
    docs(InlineVariableComment): Add inline code comment (#3177757)
    

klausi’s picture

Status: Needs review » Fixed

Merged, thanks a lot!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.