| 1 | <?php |
||
| 8 | class Regexp extends BaseValidator { |
||
| 9 | |||
| 10 | /** |
||
| 11 | * @var string |
||
| 12 | */ |
||
| 13 | protected $error = 'Invalid value'; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var string|null |
||
| 17 | */ |
||
| 18 | protected $regexp = null; |
||
| 19 | |||
| 20 | |||
| 21 | /** |
||
| 22 | * @param string $regexp |
||
| 23 | * @return $this |
||
| 24 | * @throws \InvalidArgumentException |
||
| 25 | */ |
||
| 26 | public function setRegexp($regexp) { |
||
| 33 | |||
| 34 | |||
| 35 | /** |
||
| 36 | * @param string $error |
||
| 37 | * @return $this |
||
| 38 | */ |
||
| 39 | public function setError($error) { |
||
| 43 | |||
| 44 | |||
| 45 | /** |
||
| 46 | * @todo check if we can pass array |
||
| 47 | * |
||
| 48 | * @param string $value |
||
| 49 | * @return bool |
||
| 50 | */ |
||
| 51 | public function isValid($value) { |
||
| 65 | |||
| 66 | } |