Skip to content

Commit

Permalink
Make this client adapter compatible with PSR18. (php-http#51)
Browse files Browse the repository at this point in the history
* Make this client adapter compatible with PSR18.

* Show provide

* Add return type hint

* syntax

* Better deps

* Update composer.json

* Update integration test package version

* bump branch alias to 2.x

* "psr/http-client": "^1.0",
  • Loading branch information
Nyholm authored Nov 13, 2018
1 parent 312aa49 commit de1ebb7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@
],
"require": {
"php": "^7.1",
"php-http/httplug": "^1.0",
"php-http/httplug": "^2.0",
"psr/http-client": "^1.0",
"guzzlehttp/guzzle": "^6.0"
},
"require-dev": {
"ext-curl": "*",
"php-http/client-integration-tests": "^0.6"
"php-http/client-integration-tests": "^2.0"
},
"provide": {
"php-http/client-implementation": "1.0",
"php-http/async-client-implementation": "1.0"
"php-http/async-client-implementation": "1.0",
"psr/http-client-implementation": "1.0"
},
"autoload": {
"psr-4": {
Expand All @@ -43,7 +45,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.2-dev"
"dev-master": "2.x-dev"
}
}
}
3 changes: 2 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Http\Client\HttpAsyncClient;
use Http\Client\HttpClient;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;

/**
* HTTP Adapter for Guzzle 6.
Expand Down Expand Up @@ -49,7 +50,7 @@ public static function createWithConfig(array $config)
/**
* {@inheritdoc}
*/
public function sendRequest(RequestInterface $request)
public function sendRequest(RequestInterface $request): ResponseInterface
{
$promise = $this->sendAsyncRequest($request);

Expand Down

0 comments on commit de1ebb7

Please sign in to comment.