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

Commit cd6f7f9

Browse files
committed
Fixing failing tests and code style issues.
1 parent 7191ea0 commit cd6f7f9

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/Client.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
namespace Http\Adapter\Guzzle6;
44

5+
use function Clue\StreamFilter\fun;
6+
use function foo\func;
57
use GuzzleHttp\Client as GuzzleClient;
68
use GuzzleHttp\ClientInterface;
79
use GuzzleHttp\HandlerStack;
810
use GuzzleHttp\Middleware;
911
use Http\Client\HttpAsyncClient;
1012
use Http\Client\HttpClient;
13+
use Http\Message\Exception;
1114
use Psr\Http\Message\RequestInterface;
15+
use Psr\Http\Message\ResponseInterface;
1216

1317
/**
1418
* HTTP Adapter for Guzzle 6.
@@ -51,7 +55,7 @@ public static function createWithConfig(array $config)
5155
*/
5256
public function sendRequest(RequestInterface $request)
5357
{
54-
$promise = $this->sendAsyncRequest($request);
58+
$promise = $this->sendAsyncRequest($request)->wait();
5559

5660
return $promise->wait();
5761
}

src/Promise.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function wait($unwrap = true)
9797
$this->promise->wait(false);
9898

9999
if ($unwrap) {
100-
if ($this->getState() == self::REJECTED) {
100+
if (self::REJECTED == $this->getState()) {
101101
return rejection_for($this->exception);
102102
}
103103

tests/PromiseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ public function testNonDomainExceptionIsHandled()
2121

2222
$guzzlePromise = new Promise($promise, $request->reveal());
2323

24-
$guzzlePromise->wait();
24+
$guzzlePromise->wait()->wait();
2525
}
2626
}

0 commit comments

Comments
 (0)