Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

Commit de1ebb7

Browse files
authored
Make this client adapter compatible with PSR18. (#51)
* 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",
1 parent 312aa49 commit de1ebb7

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

composer.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@
1616
],
1717
"require": {
1818
"php": "^7.1",
19-
"php-http/httplug": "^1.0",
19+
"php-http/httplug": "^2.0",
20+
"psr/http-client": "^1.0",
2021
"guzzlehttp/guzzle": "^6.0"
2122
},
2223
"require-dev": {
2324
"ext-curl": "*",
24-
"php-http/client-integration-tests": "^0.6"
25+
"php-http/client-integration-tests": "^2.0"
2526
},
2627
"provide": {
2728
"php-http/client-implementation": "1.0",
28-
"php-http/async-client-implementation": "1.0"
29+
"php-http/async-client-implementation": "1.0",
30+
"psr/http-client-implementation": "1.0"
2931
},
3032
"autoload": {
3133
"psr-4": {
@@ -43,7 +45,7 @@
4345
},
4446
"extra": {
4547
"branch-alias": {
46-
"dev-master": "1.2-dev"
48+
"dev-master": "2.x-dev"
4749
}
4850
}
4951
}

src/Client.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Http\Client\HttpAsyncClient;
1010
use Http\Client\HttpClient;
1111
use Psr\Http\Message\RequestInterface;
12+
use Psr\Http\Message\ResponseInterface;
1213

1314
/**
1415
* HTTP Adapter for Guzzle 6.
@@ -49,7 +50,7 @@ public static function createWithConfig(array $config)
4950
/**
5051
* {@inheritdoc}
5152
*/
52-
public function sendRequest(RequestInterface $request)
53+
public function sendRequest(RequestInterface $request): ResponseInterface
5354
{
5455
$promise = $this->sendAsyncRequest($request);
5556

0 commit comments

Comments
 (0)