Total Complexity | 4 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class RegionZipRule implements ValidationRule |
||
13 | { |
||
14 | /** |
||
15 | * Run the validation rule. |
||
16 | * |
||
17 | * @param string $attribute |
||
18 | * @param mixed $value |
||
19 | * @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail |
||
20 | * @return void |
||
21 | */ |
||
22 | public function validate(string $attribute, mixed $value, \Closure $fail): void |
||
23 | { |
||
24 | if (!$this->passes($attribute, $value)) { |
||
25 | $fail($this->message()); |
||
26 | } |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Determine if the validation rule passes. |
||
31 | * |
||
32 | * @param string $attribute |
||
33 | * @param mixed $value |
||
34 | * @return bool |
||
35 | */ |
||
36 | public function passes($attribute, $value) |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * Get the validation error message. |
||
43 | * |
||
44 | * @return string|array |
||
45 | */ |
||
46 | public function message() |
||
49 | } |
||
50 | } |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.