| 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 | * @return bool |
||
| 20 | */ |
||
| 21 | public abstract function isValid($value); |
||
| 22 | |||
| 23 | |||
| 24 | /** |
||
| 25 | * @deprecated use new keyword instead |
||
| 26 | * |
||
| 27 | * @return Base |
||
| 28 | */ |
||
| 29 | public static function i() { |
||
| 33 | |||
| 34 | |||
| 35 | /** |
||
| 36 | * @param string $message |
||
| 37 | * @return $this |
||
| 38 | */ |
||
| 39 | 6 | public function addError($message) { |
|
| 43 | |||
| 44 | |||
| 45 | /** |
||
| 46 | * @return bool |
||
| 47 | */ |
||
| 48 | 1 | public function hasErrors() { |
|
| 51 | |||
| 52 | |||
| 53 | /** |
||
| 54 | * @return array |
||
| 55 | */ |
||
| 56 | 6 | public function getErrors() { |
|
| 59 | |||
| 60 | |||
| 61 | /** |
||
| 62 | * @return null|string |
||
| 63 | */ |
||
| 64 | 2 | public function getFirstError() { |
|
| 67 | } |