| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 226 | public function handle(Request $request) : Response |
|
| 34 | { |
||
| 35 | 226 | if ($this->connection->isClosed()) { |
|
| 36 | 222 | $this->connection->open(); |
|
| 37 | } |
||
| 38 | |||
| 39 | 186 | $data = $this->packer->pack($request); |
|
| 40 | 186 | $data = $this->connection->send($data); |
|
| 41 | |||
| 42 | 178 | $response = $this->packer->unpack($data); |
|
| 43 | 178 | if (!$response->isError()) { |
|
| 44 | 170 | return $response; |
|
| 45 | } |
||
| 46 | |||
| 47 | 26 | throw RequestFailed::fromErrorResponse($response); |
|
| 48 | } |
||
| 60 |