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