Skip to content

PEAR.Commenting.FunctionComment does not support intersection types in comments #2530

Closed
@Stadly

Description

@Stadly

Squiz.Commenting.FunctionCommentSniff does not seem to support intersection types.

/**
 * @param (TranslatorInterface&LocaleAwareInterface)|null $translator Translator for translating messages.
 */
public function setTranslator(?TranslatorInterface $translator): void
{
    $this->translator = $translator;
}

Incorrectly generates the following errors:

  4 | ERROR | Doc comment for parameter &LocaleAwareInterface)|null does not match actual variable name
    |       | $translator (Squiz.Commenting.FunctionComment.ParamNameNoMatch)
  4 | ERROR | Parameter comment must start with a capital letter
    |       | (Squiz.Commenting.FunctionComment.ParamCommentNotCapital)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions