| 1 | <?php  | 
            ||
| 9 | abstract class AbstractValidator  | 
            ||
| 10 | { | 
            ||
| 11 | |||
| 12 | /**  | 
            ||
| 13 | * @var string Last Error description  | 
            ||
| 14 | */  | 
            ||
| 15 | protected $errorDescription = null;  | 
            ||
| 16 | |||
| 17 | /**  | 
            ||
| 18 | * @var array $params  | 
            ||
| 19 | */  | 
            ||
| 20 | protected $params = [];  | 
            ||
| 21 | |||
| 22 | /**  | 
            ||
| 23 | * @return bool  | 
            ||
| 24 | */  | 
            ||
| 25 | public function isRequired()  | 
            ||
| 29 | |||
| 30 | /**  | 
            ||
| 31 | * @return bool  | 
            ||
| 32 | */  | 
            ||
| 33 | public function isNested()  | 
            ||
| 37 | |||
| 38 | /**  | 
            ||
| 39 | * Gets error description  | 
            ||
| 40 | *  | 
            ||
| 41 | * @return mixed  | 
            ||
| 42 | */  | 
            ||
| 43 | public function getErrorDescription()  | 
            ||
| 47 | |||
| 48 | |||
| 49 | /**  | 
            ||
| 50 | * Sets error description  | 
            ||
| 51 | *  | 
            ||
| 52 | * @param string $error  | 
            ||
| 53 | *  | 
            ||
| 54 | */  | 
            ||
| 55 | public function setErrorDescription($error)  | 
            ||
| 59 | |||
| 60 | /*  | 
            ||
| 61 | * Sets custom params  | 
            ||
| 62 | *  | 
            ||
| 63 | * @param array $arr  | 
            ||
| 64 | *  | 
            ||
| 65 | * @return void  | 
            ||
| 66 | */  | 
            ||
| 67 | public function setParams($arr = [])  | 
            ||
| 73 | |||
| 74 | |||
| 75 | /**  | 
            ||
| 76 | *  | 
            ||
| 77 | * @param mixed $nodeData  | 
            ||
| 78 | *  | 
            ||
| 79 | * @return bool  | 
            ||
| 80 | */  | 
            ||
| 81 | abstract public function isValid($nodeData);  | 
            ||
| 82 | }  | 
            ||
| 83 |