|
22 | 22 | use Http\Client\Common\Plugin\ErrorPlugin;
|
23 | 23 | use Http\Client\Common\PluginClient;
|
24 | 24 | use Http\Client\Exception\HttpException;
|
25 |
| -use Http\Client\Exception\RequestException; |
26 | 25 | use Http\Client\HttpClient;
|
27 |
| -use Http\Discovery\MessageFactoryDiscovery; |
28 | 26 | use Http\Message\RequestFactory;
|
29 | 27 | use Psr\Http\Message\RequestInterface;
|
30 | 28 |
|
@@ -63,7 +61,7 @@ class Session implements SessionInterface
|
63 | 61 | /**
|
64 | 62 | * @param string $uri
|
65 | 63 | * @param GuzzleClient|HttpClient $httpClient
|
66 |
| - * @param BaseConfiguration $config |
| 64 | + * @param ConfigInterface $config |
67 | 65 | */
|
68 | 66 | public function __construct($uri, $httpClient, ConfigInterface $config)
|
69 | 67 | {
|
@@ -154,9 +152,8 @@ public function flush(Pipeline $pipeline)
|
154 | 152 |
|
155 | 153 | throw $exception;
|
156 | 154 | }
|
157 |
| - $results = $this->responseFormatter->format(json_decode($response->getBody(), true), $pipeline->statements()); |
158 | 155 |
|
159 |
| - return $results; |
| 156 | + return $this->responseFormatter->format($data, $pipeline->statements()); |
160 | 157 | } catch (HttpException $e) {
|
161 | 158 | $body = json_decode($e->getResponse()->getBody(), true);
|
162 | 159 | if (!isset($body['code'])) {
|
@@ -287,7 +284,7 @@ public function pushToTransaction($transactionId, array $statementsStack)
|
287 | 284 | throw $exception;
|
288 | 285 | }
|
289 | 286 |
|
290 |
| - return $this->responseFormatter->format(json_decode($response->getBody(), true), $statementsStack); |
| 287 | + return $this->responseFormatter->format($data, $statementsStack); |
291 | 288 | } catch (HttpException $e) {
|
292 | 289 | $body = json_decode($e->getResponse()->getBody(), true);
|
293 | 290 | if (!isset($body['code'])) {
|
|
0 commit comments