View Issue Details

IDProjectCategoryView StatusLast Update
0001830XdebugCode Coveragepublic2020-08-11 18:13
ReporterNeunerlei Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status confirmedResolutionopen 
Product Version2.9.5 
Summary0001830: "Use" Trait Statement marked as "executable" code
DescriptionHello there,

as described here: https://github.com/sebastianbergmann/php-code-coverage/issues/790
and especially: https://github.com/sebastianbergmann/php-code-coverage/issues/790#issuecomment-671086908

it seems to be the case, that xdebug reports lines with "use" statements, to include class traits, as executable,
which breaks php-code-coverage.

The issue only appears on PHP 7.3 and not PHP 7.4 (I switched to 7.4 and it works there)

I hope this helps.
Thank you :)
TagsNo tags attached.
Operating SystemLinux
PHP Version7.3.10-7.3.14

Activities

derick

2020-08-11 12:26

administrator   ~0005439

Hi!

I'm going to need a short reproducible case.

In this, please *only* include the code that has and uses the trait, and causes this issue with code overage. I don't need or want any PHP Unit test case, composer library, etc.

cheers,
Derick

Neunerlei

2020-08-11 13:08

reporter  

Neunerlei

2020-08-11 13:08

reporter   ~0005440

I'm not an author of the code-coverage library. Therefore I can't give you the details.
However while testing for the issue the minimal, reproducible setup were two files:

A.php:
<?php
declare(strict_types=1);

namespace Neunerlei\Arrays;

class A
{
    use ATrait;
}

ATrait.php
<?php
declare(strict_types=1);

namespace Neunerlei\Arrays;

trait ATrait
{

}

In that case A.php:8 is marked as "not executed"

I resolved the issue for me, by migrating to PHP 7.4 where everything works as expected.

Martin

derick

2020-08-11 18:13

administrator   ~0005441

I think I see the problem. Will have a good look tomorrow.

Thanks!

Issue History

Date Modified Username Field Change
2020-08-10 19:37 Neunerlei New Issue
2020-08-11 12:26 derick Assigned To => derick
2020-08-11 12:26 derick Status new => feedback
2020-08-11 12:26 derick Note Added: 0005439
2020-08-11 13:08 Neunerlei File Added: 2020-08-11 15_07_10-Code Coverage for _var_www_html_neunerlei_arrays_Classes_A.php.png
2020-08-11 13:08 Neunerlei Note Added: 0005440
2020-08-11 13:08 Neunerlei Status feedback => assigned
2020-08-11 18:13 derick Status assigned => confirmed
2020-08-11 18:13 derick Note Added: 0005441