Skip to content

Commit

Permalink
Only support php-http/client-common 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm committed May 21, 2020
1 parent 86e3272 commit 3f9b70e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"php": "^7.1",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
"php-http/client-common": "^1.9 || ^2.0",
"php-http/client-common": "^2.0",
"php-http/discovery": "^1.7",
"webmozart/assert": "^1.4"
},
Expand Down
3 changes: 2 additions & 1 deletion src/Http/AuthenticationPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace HappyrMatch\ApiClient\Http;

use Http\Client\Common\Plugin;
use Http\Promise\Promise;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;

Expand Down Expand Up @@ -40,7 +41,7 @@ public function __construct(Authenticator $authenticator, string $accessToken)
$this->accessToken = \json_decode($accessToken, true);
}

public function handleRequest(RequestInterface $request, callable $next, callable $first)
public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise
{
if (null === $this->accessToken || $request->hasHeader('Authorization')) {
return $next($request);
Expand Down

0 comments on commit 3f9b70e

Please sign in to comment.