Skip to content

Commit a83c3e8

Browse files
committed
Update Issues metric to count installed packages from composer output
1 parent 465183b commit a83c3e8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/Nova/Metrics/Issues.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ public function calculate(NovaRequest $request): ValueResult
3333
$process = Process::fromShellCommandline("$composer outdated $devFlag -f json", base_path(), ['COMPOSER_HOME' => $home]);
3434
$process->run();
3535
$value = $process->getOutput();
36-
return $this->result($value);
36+
$data = json_decode($value, true);
37+
$count = count($data['installed'] ?? []);
38+
return $this->result($count);
3739

3840

3941
}

0 commit comments

Comments
 (0)