rectorphp / rector-phpunit

Rector upgrade rules for PHPUnit
http://getrector.com
MIT License
61 stars 46 forks source link

Remove codeCoverageIgnore from annotations to attributes set #266

Closed marmichalski closed 9 months ago

marmichalski commented 9 months ago

This is no longer deprecated as of 10.4 https://github.com/sebastianbergmann/phpunit/blob/10.4/ChangeLog-10.4.md#changed.

TomasVotruba commented 9 months ago

What is a benefit over native attribute? The idea of upgrade is not to avoid the deprecated code, but rather use the best PHP version as soon as possible :)

marmichalski commented 9 months ago

The benefit is that the attribute has now been deprecated :)

https://github.com/sebastianbergmann/phpunit/blob/10.4/src/Framework/Attributes/CodeCoverageIgnore.php#L19

So rector with phpunit 10.4 wants to change non deprecated annotation to deprecated attribute.

TomasVotruba commented 9 months ago

I see. I think this will need better migration once PHPUnit 11 lands. Adding and removing annotations/attributes back and forth would break the upgrade flow.

Let's wait what PHPUnit 11 brings :)

marmichalski commented 9 months ago

Sure, but currently rector conflicts with phpstan inspections, as I don't think there is any easy way to remove that single conversion in consuming project? Other than overriding the service probably?

TomasVotruba commented 9 months ago

I'd ignore this in PHPStan, as it's a single line easy solution.