Skip to content

Commit

Permalink
Replaced deprecated function unwrap()
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis committed Oct 1, 2020
1 parent e791606 commit a5a541e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
9 changes: 5 additions & 4 deletions composer.json
Expand Up @@ -14,11 +14,12 @@
}
],
"require" : {
"php" : ">=7.2",
"ext-json" : "*",
"php" : ">=7.2",
"ext-json" : "*",

"jbzoo/data" : "^4.0.1",
"jbzoo/utils" : "^4.2.1"
"jbzoo/data" : "^4.0.1",
"jbzoo/utils" : "^4.2.1",
"guzzlehttp/promises" : ">=1.4.0"
},

"require-dev" : {
Expand Down
10 changes: 1 addition & 9 deletions src/Driver/Guzzle.php
Expand Up @@ -21,8 +21,6 @@
use JBZoo\HttpClient\Request;
use JBZoo\HttpClient\Response;

use function GuzzleHttp\Promise\unwrap;

/**
* Class Guzzle
* @package JBZoo\HttpClient\Driver
Expand Down Expand Up @@ -59,7 +57,6 @@ public function request(Request $request): Response

/**
* @inheritDoc
* @psalm-suppress DeprecatedFunction
*/
public function multiRequest(array $requestList): array
{
Expand All @@ -79,12 +76,7 @@ public function multiRequest(array $requestList): array
);
}

if (function_exists('\GuzzleHttp\Promise\unwrap')) {
/** @phan-suppress-next-line PhanDeprecatedFunction */
$httpResults = unwrap($promises);
} else {
$httpResults = Utils::unwrap($promises);
}
$httpResults = Utils::unwrap($promises);

$result = [];
foreach ($httpResults as $name => $httpResult) {
Expand Down

0 comments on commit a5a541e

Please sign in to comment.