Skip to content

Commit a6df305

Browse files
Nyholmdbu
authored andcommitted
Added backwards compatibility layer
1 parent 700fbb4 commit a6df305

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Plugin/VersionBridgePlugin.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Http\Client\Common\Plugin;
44

5+
use Http\Promise\Promise;
56
use Psr\Http\Message\RequestInterface;
67

78
/**
@@ -14,7 +15,7 @@ trait VersionBridgePlugin
1415
{
1516
abstract protected function doHandleRequest(RequestInterface $request, callable $next, callable $first);
1617

17-
public function handleRequest(RequestInterface $request, callable $next, callable $first)
18+
public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise
1819
{
1920
return $this->doHandleRequest($request, $next, $first);
2021
}

src/VersionBridgeClient.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Http\Client\Common;
44

55
use Psr\Http\Message\RequestInterface;
6+
use Psr\Http\Message\ResponseInterface;
67

78
/**
89
* A client that helps you migrate from php-http/httplug 1.x to 2.x. This
@@ -14,7 +15,7 @@ trait VersionBridgeClient
1415
{
1516
abstract protected function doSendRequest(RequestInterface $request);
1617

17-
public function sendRequest(RequestInterface $request)
18+
public function sendRequest(RequestInterface $request): ResponseInterface
1819
{
1920
return $this->doSendRequest($request);
2021
}

0 commit comments

Comments
 (0)