Skip to content

Symfony.Commenting.Annotations.Invalid triggers on PHPdoc annotations grouped by php-cs-fixer #196

Open
@landure

Description

@landure

With this header added to PHP files:

<?php

/**
 * @author Firstname Lastname
 * @copyright 2023 Company
 * @license MIT
 *
 * This file is part of Project.
 *
 * For the full copyright and license information, please view the LICENSE
 * file distributed with this source code.
 */

When using phpcs in addition to php-cs-fixer,

  1. php-cs-fixer's phpdoc_separation rule group @author, @copyright and @license annotations together (like the example above).
  2. phpcs's Symfony.Commenting.Annotations.Invalid rule detect this grouping as invalid.

Generally, the Symfony.Commenting.Annotations.Invalid rule will trigger on any PHPDoc annotations grouped together if they are not the same.

Fix proposal

Either ignore PHPDoc annotations in the regex (bad fix), or implement php-cs-fixer's phpdoc_separation grouping.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions