Skip to content

Add no_superfluous_phpdoc_tags fixer to .phpcs config #33150

Closed
@tigitz

Description

@tigitz

Description
As Symfony is moving towards type hinted code, the suggested no_superfluous_phpdoc_tags fixer will make sure that no legacy annotations will remain and thus be superfluous after the newly added type hints.

no_superfluous_phpdoc_tags

Removes @param and @return tags that don't provide any useful information.

Configuration options:

allow_mixed (bool): whether type mixed without description is allowed (true) or considered superfluous (false); defaults to false

If core team agrees on the principle, two questions remain to be addressed to enforce this rule:

  • What would be the value of the allow_mixed config option ?
  • Should it be added to the @Symfony php-cs-fixer ruleset ?

Example

Example from a recently accepted and merged cleaning:
4bab40b#diff-01e66dbb0ac811a0285568bb5dfbe8d1L192

PR using this new fixer: #33151

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions