Explicitly ignore lines containing Class/Trait/Interface tokens (again) #775
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For #774
In currently released versions of php-code-coverage
CodeCoverage->getLinesToBeIgnoredInner()
is called for every file included in the whitelist. This was shared logic between files that were actually processed by a driver and uncovered files that were not. This had the effect that all files passed through our own version of an executable-code detector, which removed lines with class declarations.In #757, this was refactored so that the inbuilt executable-code detector was only used for uncovered added files. For processed files, the driver's implementation is relied on.
However fixing that issue has revealed https://bugs.xdebug.org/view.php?id=1798 which was previously hidden. Depending on the precise execution path of the test suite, under Xdebug the class declaration in the affected files can show up as (1) non-executable (2) executable but covered by the first test that uses it (3) executable but uncovered. PCOV and PHPDBG are unaffected and always have behaviour (1).
This PR is a small partial revert of #757 to make class declarations always considered non-executable again regardless of what the driver data says.