Skip to content

Commit

Permalink
chore(coverage-diff): use relative path for coverage files
Browse files Browse the repository at this point in the history
  • Loading branch information
Orkuncakilkaya committed Sep 3, 2024
1 parent b5239ef commit f670f21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions coverage.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
$markdown .= "|------|-------------------|------------------------|----------------|\n";

foreach ($arr["project"]["file"] as $file) {
$filePath = $file["@attributes"]["name"];
$filePath = 'src/' . explode('src/', $file["@attributes"]['name'])[1];
$fileMetrics = $file["metrics"]["@attributes"];

$methodsPct = $fileMetrics["methods"] > 0 ? ($fileMetrics["coveredmethods"] / $fileMetrics["methods"]) * 100 : 0;
Expand All @@ -58,7 +58,7 @@

$markdown .= sprintf(
"| %s | %.2f%% | %.2f%% | %.2f%% |\n",
basename($filePath),
$filePath,
$methodsPct,
$statementsPct,
$totalCoveragePct
Expand Down

0 comments on commit f670f21

Please sign in to comment.