1 | <?php |
||
9 | abstract class BaseValidator implements ValidatorInterface { |
||
10 | |||
11 | /** |
||
12 | * @var array |
||
13 | */ |
||
14 | protected $errors = []; |
||
15 | |||
16 | |||
17 | /** |
||
18 | * @param string $value |
||
19 | */ |
||
20 | public abstract function isValid($value); |
||
21 | |||
22 | |||
23 | /** |
||
24 | * @deprecated use new keyword instead |
||
25 | * |
||
26 | * @return Base |
||
27 | */ |
||
28 | public static function i() { |
||
32 | |||
33 | |||
34 | /** |
||
35 | * @param string $message |
||
36 | * @return Base |
||
37 | */ |
||
38 | 5 | public function addError($message) { |
|
42 | |||
43 | |||
44 | /** |
||
45 | * @return bool |
||
46 | */ |
||
47 | 4 | public function hasErrors() { |
|
50 | |||
51 | |||
52 | /** |
||
53 | * @return array |
||
54 | */ |
||
55 | public function getErrors() { |
||
58 | |||
59 | |||
60 | /** |
||
61 | * @return Base |
||
62 | */ |
||
63 | 5 | public function flushErrors() { |
|
67 | |||
68 | |||
69 | /** |
||
70 | * @return null|string |
||
71 | */ |
||
72 | 1 | public function getFirstError() { |
|
75 | } |