Skip to content

Commit

Permalink
Minor formatting improvement; building PHAR file; adding test coverag…
Browse files Browse the repository at this point in the history
…e to this edge case.
  • Loading branch information
bucefal91 committed Jul 27, 2022
1 parent c4b53b7 commit 0b8bfb4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Binary file modified build/kint.phar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ 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)) {
if (!\is_array($packages)) {
continue;
}

Expand Down
3 changes: 3 additions & 0 deletions tests/UtilsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ public function testComposerGetExtras()
]));

$this->assertSame(['more' => 'test', 'data', 'test' => 'ing'], Utils::composerGetExtras('kint'));

\file_put_contents($this->composer_test_dir.'/composer/installed.json', 'malformed JSON.');
$this->assertEmpty(Utils::composerGetExtras('kint'));
}

public function traceProvider()
Expand Down

0 comments on commit 0b8bfb4

Please sign in to comment.