Skip to content

Commit

Permalink
Fixed issue with json format
Browse files Browse the repository at this point in the history
  • Loading branch information
jhhazelaar committed Feb 6, 2024
1 parent 9925327 commit 1a438be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Checks/OutdatedCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
use Illuminate\Support\Facades\Process;
use Spatie\Health\Checks\Check;
use Spatie\Health\Checks\Result;
use Illuminate\Support\Arr;

class OutdatedCheck extends Check
{
public function run(): Result
{
$result = Process::run('composer outdated -D --format=json');
$result = Process::run('composer outdated -D --no-dev --format=json');

$outdated = collect(json_decode($result->output(), true));
$outdated = collect(Arr::get(json_decode($result->output(), true), 'installed'));

if ($outdated->isEmpty()) {
return Result::make('No outdated packages found')->ok();
Expand Down

0 comments on commit 1a438be

Please sign in to comment.