@@ -71,15 +71,15 @@ discard block |
||
| 71 | 71 | { |
| 72 | 72 | $newPromise = new self($this->loop); |
| 73 | 73 | |
| 74 | - $onFulfilled = null !== $onFulfilled ? $onFulfilled : function (ResponseInterface $response) { |
|
| 74 | + $onFulfilled = null !== $onFulfilled ? $onFulfilled : function(ResponseInterface $response) { |
|
| 75 | 75 | return $response; |
| 76 | 76 | }; |
| 77 | 77 | |
| 78 | - $onRejected = null !== $onRejected ? $onRejected : function (Exception $exception) { |
|
| 78 | + $onRejected = null !== $onRejected ? $onRejected : function(Exception $exception) { |
|
| 79 | 79 | throw $exception; |
| 80 | 80 | }; |
| 81 | 81 | |
| 82 | - $this->onFulfilled = function (ResponseInterface $response) use ($onFulfilled, $newPromise) { |
|
| 82 | + $this->onFulfilled = function(ResponseInterface $response) use ($onFulfilled, $newPromise) { |
|
| 83 | 83 | try { |
| 84 | 84 | $return = $onFulfilled($response); |
| 85 | 85 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | } |
| 90 | 90 | }; |
| 91 | 91 | |
| 92 | - $this->onRejected = function (Exception $exception) use ($onRejected, $newPromise) { |
|
| 92 | + $this->onRejected = function(Exception $exception) use ($onRejected, $newPromise) { |
|
| 93 | 93 | try { |
| 94 | 94 | $newPromise->resolve($onRejected($exception)); |
| 95 | 95 | } catch (Exception $exception) { |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | { |
| 178 | 178 | $loop = $this->loop; |
| 179 | 179 | while (HttpPromise::PENDING === $this->getState()) { |
| 180 | - $loop->futureTick(function () use ($loop) { |
|
| 180 | + $loop->futureTick(function() use ($loop) { |
|
| 181 | 181 | $loop->stop(); |
| 182 | 182 | }); |
| 183 | 183 | $loop->run(); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $reactRequest = $this->buildReactRequest($request); |
| 95 | 95 | $promise = new Promise($this->loop); |
| 96 | 96 | |
| 97 | - $reactRequest->on('error', function (\Exception $error) use ($promise, $request) { |
|
| 97 | + $reactRequest->on('error', function(\Exception $error) use ($promise, $request) { |
|
| 98 | 98 | $promise->reject(new RequestException( |
| 99 | 99 | $error->getMessage(), |
| 100 | 100 | $request, |
@@ -102,13 +102,13 @@ discard block |
||
| 102 | 102 | )); |
| 103 | 103 | }); |
| 104 | 104 | |
| 105 | - $reactRequest->on('response', function (ReactResponse $reactResponse = null) use ($promise, $request) { |
|
| 105 | + $reactRequest->on('response', function(ReactResponse $reactResponse = null) use ($promise, $request) { |
|
| 106 | 106 | $bodyStream = $this->streamFactory->createStream(); |
| 107 | - $reactResponse->on('data', function ($data) use (&$bodyStream) { |
|
| 107 | + $reactResponse->on('data', function($data) use (&$bodyStream) { |
|
| 108 | 108 | $bodyStream->write((string) $data); |
| 109 | 109 | }); |
| 110 | 110 | |
| 111 | - $reactResponse->on('end', function (\Exception $error = null) use ($promise, $request, $reactResponse, &$bodyStream) { |
|
| 111 | + $reactResponse->on('end', function(\Exception $error = null) use ($promise, $request, $reactResponse, &$bodyStream) { |
|
| 112 | 112 | $response = $this->buildResponse( |
| 113 | 113 | $reactResponse, |
| 114 | 114 | $bodyStream |