phpunit icon indicating copy to clipboard operation
phpunit copied to clipboard

Remove support for the `@codeCoverageIgnore*` annotations and the `CodeCoverageIgnore` attribute

Open sebastianbergmann opened this issue 2 years ago • 1 comments

Originally posted by @sebastianbergmann in https://github.com/sebastianbergmann/phpunit/issues/5235#issuecomment-1441559663

sebastianbergmann avatar Feb 23 '23 13:02 sebastianbergmann

Regarding the intended replacement for the feature being removed here,

When at least one test class has a IgnoreClassForCodeCoverage, IgnoreMethodForCodeCoverage, or IgnoreFunctionForCodeCoverage attribute then the specified code unit will be ignored for code coverage (PHPUnit 10.1)

This "spooky action at a distance" seems like a poor design. One test class somewhere has one of these attributes and the referenced code is globally ignored for coverage?

If you really don't want to support the inline comments anymore, perhaps you should remove coverage ignoring entirely and recommend people have PHPUnit write the coverage data to a machine-readable format and use some more capable post-processor that still understands the inline comments to generate the report.

anomiex avatar Jun 09 '23 10:06 anomiex

Superseded by #5513.

sebastianbergmann avatar Sep 16 '23 05:09 sebastianbergmann