Total Complexity | 5 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
15 | class Error extends AAnswer |
||
16 | { |
||
17 | protected int $errorCode = 0; |
||
18 | protected string $errorMessage = ''; |
||
19 | protected bool $hardWay = false; |
||
20 | |||
21 | 1 | public function setHardWay(bool $hardWay): self |
|
22 | { |
||
23 | 1 | $this->hardWay = $hardWay; |
|
24 | 1 | return $this; |
|
25 | } |
||
26 | |||
27 | 3 | public function process(): parent |
|
28 | { |
||
29 | 3 | $this->errorMessage = substr($this->answer->getContent(), 0, -1); |
|
30 | 3 | $extra = $this->answer->getExtraData(); |
|
31 | 3 | if (!empty($extra)) { |
|
32 | 1 | $this->errorCode = Fsp\Strings::mb_ord($extra); |
|
33 | } |
||
34 | 3 | return $this; |
|
|
|||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @throws RequestException |
||
39 | * @return RequestException |
||
40 | */ |
||
41 | 3 | public function getError(): RequestException |
|
48 | } |
||
49 | } |
||
50 |