1 | <?php |
||
12 | final class Reply |
||
13 | { |
||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | private $lines = []; |
||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | private $codes = []; |
||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | private $messages = []; |
||
26 | /** |
||
27 | * @var Client |
||
28 | */ |
||
29 | private $client; |
||
30 | |||
31 | /** |
||
32 | * Reply constructor. |
||
33 | * @param Client $client |
||
34 | */ |
||
35 | 28 | public function __construct(Client $client) |
|
39 | |||
40 | /** |
||
41 | * @return bool |
||
42 | */ |
||
43 | 6 | public function isError(): bool |
|
52 | |||
53 | /** |
||
54 | * @return bool |
||
55 | */ |
||
56 | 5 | public function isCommandNotImplemented(): bool |
|
65 | |||
66 | /** |
||
67 | * @return array |
||
68 | */ |
||
69 | 16 | public function getMessages(): array |
|
73 | |||
74 | /** |
||
75 | * @param int $code |
||
76 | * @param string $message |
||
77 | * @return Reply |
||
78 | */ |
||
79 | 28 | public function withLine(int $code, string $message): Reply |
|
87 | |||
88 | /** |
||
89 | * @param int $code |
||
90 | * @return Client |
||
91 | */ |
||
92 | 6 | public function assert(int $code): Client { |
|
95 | |||
96 | /** |
||
97 | * @return Client |
||
98 | */ |
||
99 | 16 | public function assertCompleted(): Client { |
|
102 | |||
103 | /** |
||
104 | * @return Client |
||
105 | */ |
||
106 | 6 | public function assertIntermediate(): Client { |
|
109 | |||
110 | /** |
||
111 | * @param int $min |
||
112 | * @param int $max |
||
113 | * @return Client |
||
114 | * @throws AssertionFailedException |
||
115 | */ |
||
116 | 23 | private function assertBetween(int $min, int $max): Client |
|
133 | |||
134 | /** |
||
135 | * @return string |
||
136 | */ |
||
137 | 8 | private function createErrorMessage(): string |
|
149 | } |
||
150 |