| 1 | <?php |
||
| 9 | abstract class AbstractValidator implements ValidatorInterface |
||
| 10 | { |
||
| 11 | |||
| 12 | /** @var Translate */ |
||
| 13 | private $langs; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var string[]|array |
||
| 17 | */ |
||
| 18 | protected $errors; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var boolean |
||
| 22 | */ |
||
| 23 | protected $valid; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * AbstractValidator constructor. |
||
| 27 | * |
||
| 28 | * @param Translate $langs |
||
| 29 | */ |
||
| 30 | public function __construct(Translate $langs) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param string $field |
||
| 37 | * @param string $message |
||
| 38 | */ |
||
| 39 | protected function addError($field, $message) |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return array|string[] |
||
| 51 | */ |
||
| 52 | public function getErrors() |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @param string $field |
||
| 66 | * |
||
| 67 | * @return bool |
||
| 68 | */ |
||
| 69 | public function hasError($field) |
||
| 73 | |||
| 74 | } |