Skip to content

Commit bf94d82

Browse files
committed
Merge remote-tracking branch 'origin/master' into 2.x
2 parents fc04c8e + 9c21b60 commit bf94d82

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
### Removed
1616
- Deprecated option `debug_plugins` has been removed from `PluginClient`
1717

18-
## 1.9.0 - [unreleased]
18+
## 1.9.0 - 2019-01-03
19+
20+
### Added
21+
22+
- Support for PSR-18 clients
23+
- Added traits `VersionBridgePlugin` and `VersionBridgeClient` to help plugins and clients to support both
24+
1.x and 2.x version of `php-http/client-common` and `php-http/httplug`.
1925

2026
### Changed
2127

src/EmulatedHttpAsyncClient.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,15 @@ final class EmulatedHttpAsyncClient implements HttpClient, HttpAsyncClient
1818
use HttpAsyncClientEmulator;
1919
use HttpClientDecorator;
2020

21-
public function __construct(ClientInterface $httpClient)
21+
/**
22+
* @param HttpClient|ClientInterface $httpClient
23+
*/
24+
public function __construct($httpClient)
2225
{
26+
if (!($httpClient instanceof HttpClient) && !($httpClient instanceof ClientInterface)) {
27+
throw new \LogicException('Client must be an instance of Http\\Client\\HttpClient or Psr\\Http\\Client\\ClientInterface');
28+
}
29+
2330
$this->httpClient = $httpClient;
2431
}
2532
}

0 commit comments

Comments
 (0)