1 | <?php |
||
8 | abstract class AbstractResult implements ResultInterface |
||
9 | { |
||
10 | /** |
||
11 | * @var int |
||
12 | */ |
||
13 | protected $status; |
||
14 | |||
15 | /** |
||
16 | * @var CheckException|null |
||
17 | */ |
||
18 | protected $error; |
||
19 | |||
20 | /** |
||
21 | * CheckResult constructor. |
||
22 | * |
||
23 | * @param int $status |
||
24 | * @param CheckException $error |
||
25 | */ |
||
26 | 4 | public function __construct($status, CheckException $error = null) |
|
31 | |||
32 | /** |
||
33 | * @return int |
||
34 | */ |
||
35 | 4 | public function getStatus() |
|
39 | |||
40 | /** |
||
41 | * @return CheckException|null |
||
42 | */ |
||
43 | 4 | public function getError() |
|
47 | |||
48 | /** |
||
49 | * @return bool |
||
50 | */ |
||
51 | 4 | public function isOk() |
|
55 | |||
56 | /** |
||
57 | * Get message related to the result. |
||
58 | * |
||
59 | * @return string |
||
60 | */ |
||
61 | 2 | public function getMessage() |
|
69 | |||
70 | /** |
||
71 | * Get detailed info on the test result (if available). |
||
72 | * |
||
73 | * @return mixed|null |
||
74 | */ |
||
75 | 2 | public function getData() |
|
79 | |||
80 | /** |
||
81 | * @param int $status |
||
82 | */ |
||
83 | 4 | protected function setStatus($status) |
|
87 | |||
88 | /** |
||
89 | * @param CheckException|null $error |
||
90 | */ |
||
91 | 4 | protected function setError(CheckException $error = null) |
|
95 | } |
||
96 |