Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
landure opened this issue Mar 24, 2023 · 0 comments

Comments

@landure
Copy link

landure commented Mar 24, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant