Total Complexity | 5 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class Error |
||
6 | { |
||
7 | /** |
||
8 | * @var mixed |
||
9 | */ |
||
10 | private $errorData; |
||
11 | |||
12 | /** |
||
13 | * @param array|null $errorData |
||
14 | */ |
||
15 | public function __construct($errorData = null) |
||
16 | { |
||
17 | $this->errorData = $errorData; |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * @return string|null |
||
22 | */ |
||
23 | public function getText() |
||
24 | { |
||
25 | if (isset($this->errorData['message'])) { |
||
26 | return $this->errorData['message']; |
||
27 | } |
||
28 | |||
29 | if (isset($this->errorData['code'])) { |
||
30 | return $this->errorData['code']; |
||
31 | } |
||
32 | |||
33 | return null; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * @return bool |
||
38 | */ |
||
39 | public function isEmpty() |
||
42 | } |
||
43 | } |
||
44 |