Total Complexity | 5 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class ValidPhoneNumber implements ValidationRule |
||
10 | { |
||
11 | public function __construct( |
||
12 | protected ?string $code = null |
||
13 | ){} |
||
14 | |||
15 | /** |
||
16 | * Check phone number is valid. |
||
17 | * |
||
18 | * @param string $attribute |
||
19 | * @param mixed $value |
||
20 | * @param Closure $fail |
||
21 | * @return void |
||
22 | */ |
||
23 | public function validate(string $attribute, mixed $value, Closure $fail): void |
||
24 | { |
||
25 | if (! $this->isPhoneNumberValid($value)) { |
||
26 | |||
27 | $fail('validate.phone-number')->translate(); |
||
28 | } |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Check if phone number is valid |
||
33 | * |
||
34 | * @param mixed $value |
||
35 | * @return bool |
||
36 | */ |
||
37 | private function isPhoneNumberValid(mixed $value): bool |
||
46 | } |
||
47 | } |
||
48 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths