Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
43 | public function handle(Request $request) : Response |
||
44 | { |
||
45 | if ($this->connection->isClosed()) { |
||
46 | $this->connection->open(); |
||
47 | } |
||
48 | |||
49 | $data = $this->packer->pack($request); |
||
50 | $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 |