Skip to content

Commit

Permalink
Release v1.1.2
Browse files Browse the repository at this point in the history
* Fix broken connection by returning early
  • Loading branch information
S1SYPHOS committed Jul 11, 2021
1 parent 788e76c commit e48b799
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Acknowledge the people behind your frontend dependencies - and give thanks!",
"type": "library",
"license": "MIT",
"version": "1.1.1",
"version": "1.1.2",
"keywords": ["gratitude", "appreciation", "gratefulness", "thankfulness"],
"homepage": "https://github.com/S1SYPHOS",
"scripts": {
Expand Down
6 changes: 6 additions & 0 deletions lib/Drivers/Composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ protected function process(\Shieldon\SimpleCache\Cache $cache, array $config): \
# Fetch additional information from https://packagist.org
$apiURL = 'https://repo.packagist.org/p/' . $pkgName . '.json';
$response = $this->fetchRemote($apiURL, $config['timeout'], $config['userAgent']);

# Skip processing if connection is faulty
if (empty($response)) {
return $data;
}

$response = json_decode($response, true)['packages'][$pkgName];

# Enrich data with results
Expand Down
6 changes: 6 additions & 0 deletions lib/Drivers/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ protected function process(\Shieldon\SimpleCache\Cache $cache, array $config): \
# Fetch additional information from https://api.npms.io
$apiURL = 'https://api.npms.io/v2/package/' . rawurlencode($pkgName);
$response = $this->fetchRemote($apiURL, $config['timeout'], $config['userAgent']);

# Skip processing if connection is faulty
if (empty($response)) {
return $data;
}

$response = json_decode($response)->collected->metadata;

$data['license'] = $response->license ?? '';
Expand Down
2 changes: 1 addition & 1 deletion lib/Thx.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Thx
/**
* Current version
*/
const VERSION = '1.1.1';
const VERSION = '1.1.2';


/**
Expand Down

0 comments on commit e48b799

Please sign in to comment.