| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | 226 | public function handle(Request $request) : Response |
|
| 44 | { |
||
| 45 | 226 | if ($this->connection->isClosed()) { |
|
| 46 | 220 | $this->connection->open(); |
|
| 47 | } |
||
| 48 | |||
| 49 | 186 | $data = $this->packer->pack($request); |
|
| 50 | 186 | $data = $this->connection->send($data); |
|
| 51 | |||
| 52 | 178 | $response = $this->packer->unpack($data); |
|
| 53 | 178 | if (!$response->isError()) { |
|
| 54 | 170 | return $response; |
|
| 55 | } |
||
| 56 | |||
| 57 | 26 | throw RequestFailed::fromErrorResponse($response); |
|
| 58 | } |
||
| 60 |