sebastianbergmann / php-code-coverage

Library that provides collection, processing, and rendering functionality for PHP code coverage information.
BSD 3-Clause "New" or "Revised" License
8.76k stars 370 forks source link

All ternary branches must be measured #1029

Open mvorisek opened 5 months ago

mvorisek commented 5 months ago
Q A
php-code-coverage version 10.1.11
PHP version 8.3.0
Driver Xdebug
PCOV version (if used) n/a
Xdebug version (if used) 3.3.1
Installation Method Composer
Usage Method PHPUnit
PHPUnit version (if used) 10.5.9

repro code: https://github.com/atk4/data/blob/9e46bc827f/src/Reference/ContainsOne.php#L20

https://app.codecov.io/gh/atk4/data/pull/1158/blob/src/Reference/ContainsOne.php#L20

image

Expected behaviour:

Both false/true ternary (and also null coalescing branch of null coalescing operator) must be measured.

In the screenshot above, the l20 must be either green or red.