Skip to content

Commit

Permalink
Survive through a malformed installed.json file.
Browse files Browse the repository at this point in the history
  • Loading branch information
bucefal91 committed Jul 26, 2022
1 parent 055630e commit c4b53b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ public static function composerGetExtras($key = 'kint')
if (\file_exists($installed) && \is_readable($installed)) {
$packages = \json_decode(\file_get_contents($installed), true);

if (!is_array($packages)) {
continue;
}

foreach ($packages as $package) {
if (isset($package['extra'][$key]) && \is_array($package['extra'][$key])) {
$extras = \array_replace($extras, $package['extra'][$key]);
Expand Down

0 comments on commit c4b53b7

Please sign in to comment.