From adc0b7a191d9e5a6b900e8320ac01fd5ce91b83c Mon Sep 17 00:00:00 2001 From: Doug Wright Date: Fri, 15 Sep 2023 19:06:27 +0100 Subject: [PATCH] #1012 Cobertura report pulls functions from report scope, not the individual element --- src/Report/Cobertura.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Report/Cobertura.php b/src/Report/Cobertura.php index ead31b466..138a31ebe 100644 --- a/src/Report/Cobertura.php +++ b/src/Report/Cobertura.php @@ -194,7 +194,7 @@ public function process(CodeCoverage $coverage, ?string $target = null): string } } - if ($report->numberOfFunctions() === 0) { + if ($item->numberOfFunctions() === 0) { $packageElement->setAttribute('complexity', (string) $packageComplexity); continue; @@ -218,7 +218,7 @@ public function process(CodeCoverage $coverage, ?string $target = null): string $classElement->appendChild($classLinesElement); - $functions = $report->functions(); + $functions = $item->functions(); foreach ($functions as $functionName => $function) { if ($function['executableLines'] === 0) {