View Issue Details

IDProjectCategoryView StatusLast Update
0002027XdebugCode Coveragepublic2023-11-30 14:50
Reporterdvdoug Assigned Toderick  
Status closedResolutionfixed 
Product Version3.2dev 
Target Version3.3devFixed in Version3.3.0 
Summary0002027: Branch/path code coverage for traits drops trait name since 3.1.0

Relates to

In versions of Xdebug prior to 3.1.0, traits and classes were treated the same from an output point of view. Under the functions key, there would be an array with each entry being of the format FQCN->methodName.

With Xdebug 3.1, the FQCN part is no longer included for traits.

App\FooTrait->returnsTrue => [...]

returnsTrue{trait-method:/src/FooTrait.php:9-16} => [...]

Desired (assuming the annotation has to stay):
App\FooTrait->returnsTrue{trait-method:/src/FooTrait.php:9-16} => [...]

Steps To Reproduce

The testcase from will show this

TagsNo tags attached.
Operating System
PHP Version8.0.5-8.0.9



2023-11-07 14:26

administrator   ~0006673

When analysing code, the scope is the trait name. While the code is running, the method has been copied into the class, and the scope is the class name.

I cheated earlier and removed the scope name to make code coverage work.

This "fix" is more of a plaster. We now remember the original scope and then add it when returning information.

PHP doesn't remember the original trait scope yet, but we might fix that as part of this PR:



2023-11-30 14:27

administrator   ~0006689

This PR got merged three weeks ago. I had forgotten to close this issue!

Issue History

Date Modified Username Field Change
2021-10-04 20:50 dvdoug New Issue
2021-12-08 11:19 derick Status new => acknowledged
2021-12-08 11:19 derick Product Version 3.1.0 => 3.2dev
2023-11-07 14:26 derick Assigned To => derick
2023-11-07 14:26 derick Status acknowledged => confirmed
2023-11-07 14:26 derick Note Added: 0006673
2023-11-07 14:26 derick Target Version => 3.3dev
2023-11-30 14:27 derick Status confirmed => closed
2023-11-30 14:27 derick Resolution open => fixed
2023-11-30 14:27 derick Fixed in Version => 3.3dev
2023-11-30 14:27 derick Note Added: 0006689
2023-11-30 14:50 derick Fixed in Version 3.3dev => 3.3.0