1 | <?php |
||
12 | abstract class Base { |
||
13 | |||
14 | /** |
||
15 | * @deprecated use new keyword instead |
||
16 | * |
||
17 | * @return $this |
||
18 | */ |
||
19 | public static function i() { |
||
23 | |||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $errors = []; |
||
29 | |||
30 | |||
31 | /** |
||
32 | * @param string $message |
||
33 | * @return $this |
||
34 | */ |
||
35 | 5 | public function addError($message) { |
|
39 | |||
40 | |||
41 | /** |
||
42 | * @return bool |
||
43 | */ |
||
44 | 4 | public function hasErrors() { |
|
47 | |||
48 | |||
49 | /** |
||
50 | * @return array |
||
51 | */ |
||
52 | public function getErrors() { |
||
55 | |||
56 | |||
57 | /** |
||
58 | * @return $this |
||
59 | */ |
||
60 | 5 | public function flushErrors() { |
|
64 | |||
65 | |||
66 | /** |
||
67 | * @return null|string |
||
68 | */ |
||
69 | 1 | public function getFirstError() { |
|
72 | |||
73 | |||
74 | /** |
||
75 | * @param string $value |
||
76 | */ |
||
77 | public abstract function isValid($value); |
||
78 | |||
79 | } |