| 1 | <?php |
||
| 8 | trait RuleSetTrait |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @return array |
||
| 12 | */ |
||
| 13 | abstract protected function rules(); |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param string $id |
||
| 17 | * @param string|\Closure $constraint |
||
| 18 | * |
||
| 19 | * @return void |
||
| 20 | */ |
||
| 21 | abstract protected function setRule($id, $constraint); |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param string $id |
||
| 25 | * @param string|\Closure $constraint |
||
| 26 | */ |
||
| 27 | public function set($id, $constraint) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * {@inheritdoc} |
||
| 37 | */ |
||
| 38 | public function has($id) |
||
| 42 | |||
| 43 | /** |
||
| 44 | * {@inheritdoc} |
||
| 45 | */ |
||
| 46 | public function get($id) |
||
| 60 | } |
||
| 61 |