1 | <?php |
||
9 | class Error |
||
10 | { |
||
11 | /** |
||
12 | * @static |
||
13 | * |
||
14 | * @var array Error messages. |
||
15 | */ |
||
16 | private static $errors = []; |
||
17 | |||
18 | |||
19 | /** |
||
20 | * Reset the errors. |
||
21 | */ |
||
22 | 81 | public static function reset() |
|
26 | |||
27 | |||
28 | /** |
||
29 | * Get all errors that have been set during the analysis. |
||
30 | * |
||
31 | * @return array The error messages. |
||
32 | */ |
||
33 | 76 | public function getErrors() |
|
45 | |||
46 | |||
47 | /** |
||
48 | * Add an error message. |
||
49 | * |
||
50 | * @param string $type The type of error. |
||
51 | * @param string $error The error message (or field). |
||
52 | * |
||
53 | * @return void |
||
54 | */ |
||
55 | 50 | public function setError($type, $error) |
|
63 | } |