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

PhpUnitAttributesFixer - ability to keep annotations #7956

Open
Wirone opened this issue Apr 17, 2024 · 1 comment
Open

PhpUnitAttributesFixer - ability to keep annotations #7956

Wirone opened this issue Apr 17, 2024 · 1 comment
Labels
kind/enhancement kind/feature request topic/phpdoc PHPDoc tags, Doctrine Annotations etc. topic/phpunit Fixers related to PHPUnit

Comments

@Wirone
Copy link
Member

Wirone commented Apr 17, 2024

It would be great to have an option to add the attributes without removing the annotation (which also requires checking if the attribute is already there to avoid "fixing" it multiple times). When you need to support both PHPUnit 11 (to support the latest PHPUnit version) and PHPUnit 9.6 (to support older PHP versions), the way to go is to define both the attributes (for PHPUnit 10+) and the annotation (used by PHPUnit 9 and ignored in 10+ when the attributes are present).

Originally posted by @stof in #7831 (comment)

@Wirone
Copy link
Member Author

Wirone commented Apr 17, 2024

This is actually great idea and I am surprised we did not think about it during the code review 🤔. In our case it's also required to keep annotations as we still support PHP 7.4 and PHPUnit 9.6. So basically we need to do this for ourselves too ☺️.

@Wirone Wirone added kind/enhancement kind/feature request topic/phpdoc PHPDoc tags, Doctrine Annotations etc. topic/phpunit Fixers related to PHPUnit labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement kind/feature request topic/phpdoc PHPDoc tags, Doctrine Annotations etc. topic/phpunit Fixers related to PHPUnit
Projects
None yet
Development

No branches or pull requests

1 participant