Skip to content

Commit 9472484

Browse files
authored
Added backwards compatibility layer (#133)
1 parent 724f0a1 commit 9472484

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Plugin/VersionBridgePlugin.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Http\Client\Common\Plugin;
66

7+
use Http\Promise\Promise;
78
use Psr\Http\Message\RequestInterface;
89

910
/**
@@ -16,7 +17,7 @@ trait VersionBridgePlugin
1617
{
1718
abstract protected function doHandleRequest(RequestInterface $request, callable $next, callable $first);
1819

19-
public function handleRequest(RequestInterface $request, callable $next, callable $first)
20+
public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise
2021
{
2122
return $this->doHandleRequest($request, $next, $first);
2223
}

src/VersionBridgeClient.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Http\Client\Common;
66

77
use Psr\Http\Message\RequestInterface;
8+
use Psr\Http\Message\ResponseInterface;
89

910
/**
1011
* A client that helps you migrate from php-http/httplug 1.x to 2.x. This
@@ -16,7 +17,7 @@ trait VersionBridgeClient
1617
{
1718
abstract protected function doSendRequest(RequestInterface $request);
1819

19-
public function sendRequest(RequestInterface $request)
20+
public function sendRequest(RequestInterface $request): ResponseInterface
2021
{
2122
return $this->doSendRequest($request);
2223
}

0 commit comments

Comments
 (0)