In addition to the existing tools, you can now also generate code coverage information for your code using PHPUnit and the xdebug extension.
Here is an example of how this can look like:
As with the other tools, scrutinizer filters code coverage data to only display what is relevant to your code changes. For Pushes and Pull Requests, that means only code coverage information for new code is displayed. For manual reviews, the entire code coverage for your project is generated.
Since generating code coverage can severely slow down your tests especially for bigger projects, only generating it for a a small subset will make that information available a lot faster.
You can enable generating code coverage with the following configuration:
# Since we need to run part of your test suite, most libraries will first
# need to install vendors, for example via composer.
before_commands:
- composer install --dev
tools:
php_code_coverage: true
For a more advanced configuration, you can also view the dedicated documentation about code coverage for PHP.