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