Skip to content

Commit

Permalink
Improve backwards compatibility to PHP 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
prajapati-kaushik committed Aug 2, 2022
1 parent a16fbbf commit 7aef21e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/PackagistAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public function getPackageInfo(string $package): array
try {
$response = $this->http_client->request('GET', "https://repo.packagist.org/packages/{$package}.json");
return json_decode($response->getBody()->getContents(), true) ?? [];

} catch (GuzzleException) {
} catch (GuzzleException $e) {
fwrite($this->stderr, "Could not find info for {$package} on Packagist\n");
return [];
}
Expand Down

0 comments on commit 7aef21e

Please sign in to comment.