Skip to content

Commit

Permalink
Remove composer show info
Browse files Browse the repository at this point in the history
  • Loading branch information
fr3on committed May 17, 2023
1 parent 826fbf4 commit f5412ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
13 changes: 2 additions & 11 deletions src/Sleuren.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,25 +441,16 @@ private function command($command)

private function getNpmPackages(): array
{
$npmPackages = [];
if (file_exists(base_path('package.json'))) {
$npmPackages = json_decode(file_get_contents(base_path('package.json')), true)['dependencies'] ?? [];
}
return $npmPackages;
return $npmPackages ?? [];
}

private function getComposerPackages(): array
{
$packages = [];
if (file_exists(base_path('composer.json'))) {
$packages = json_decode(file_get_contents(base_path('composer.json')), true)['require'] ?? [];
}
foreach ($packages as $key => $package) {
$result = $this->command("composer show $key -a --format=json");
if(!empty($result)) {
$data = json_decode($result, true);
$composerPackages[] = ['name' => $data['name'], 'description' => $data['description'], 'current' => $package, 'latest' => \Composer\InstalledVersions::getPrettyVersion($data['name'])];
}
$composerPackages = json_decode(file_get_contents(base_path('composer.json')), true)['require'] ?? [];
}
return $composerPackages ?? [];
}
Expand Down
2 changes: 0 additions & 2 deletions tests/SleurenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ public function it_filters_the_data_based_on_the_configuration()
],
'Password' => 'testing',
];


$this->assertContains('***', $this->sleuren->filterVariables($data));
}

Expand Down

0 comments on commit f5412ad

Please sign in to comment.