for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace MyTester\CodeCoverage;
/**
* Pcov engine for code coverage collector
*
* @author Jakub Konečný
* @internal
*/
final class PcovEngine implements \MyTester\ICodeCoverageEngine {
public function getName(): string {
return "pcov";
}
public function isAvailable(): bool {
return extension_loaded("pcov");
public function start(): void {
\pcov\start();
start
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
/** @scrutinizer ignore-call */
public function collect(): array {
$positive = $negative = [];
\pcov\stop();
stop
foreach(\pcov\collect() as $file => $lines) {
collect
foreach(/** @scrutinizer ignore-call */ \pcov\collect() as $file => $lines) {
if(!file_exists($file)) {
continue;
foreach($lines as $number => $value) {
if($value > 0) {
$positive[$file][$number] = $value;
} else {
$negative[$file][$number] = $value;
return [$positive, $negative,];
?>