Total Complexity | 8 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | abstract class AbstractFieldRuleSet implements Rule, FieldRuleSetContract |
||
13 | { |
||
14 | protected $data = []; |
||
15 | |||
16 | protected $validator; |
||
17 | |||
18 | public function __construct(array $data = []) |
||
19 | { |
||
20 | $this->data = $data; |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Determine if the validation rule passes. |
||
25 | * |
||
26 | * @param string $attribute |
||
27 | * @param mixed $value |
||
28 | * @return bool |
||
29 | */ |
||
30 | public function passes($attribute, $value) |
||
33 | } |
||
34 | |||
35 | abstract public function rules() : array; |
||
36 | |||
37 | /** |
||
38 | * @param mixed $value |
||
39 | * @param array|string|Rule $rules |
||
40 | * @param string $name Name of the property (optional) |
||
41 | * |
||
42 | * @return boolean |
||
43 | */ |
||
44 | protected function validate($value, $rules, $name = 'variable') |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Get the validation error message. |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | public function message() |
||
73 |