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