Conditions | 4 |
Paths | 3 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
30 | 1 | public function validate($attribute, $value, $parameters, $validator): bool |
|
31 | { |
||
32 | 1 | $phoneNumbers = collect(explode(',', $value)); |
|
33 | |||
34 | 1 | $invalidNumbers = []; |
|
35 | |||
36 | 1 | foreach ($phoneNumbers as $phoneNumber) { |
|
37 | 1 | $proto = $this->sanitiser->getPhoneNumberObject($phoneNumber); |
|
38 | |||
39 | 1 | if (!$proto || |
|
40 | 1 | !in_array( |
|
41 | 1 | $this->libPhoneNumber->getRegionCodeForNumber($proto), |
|
42 | 1 | config('digitonic.validation.allowed_mobile_origins') |
|
43 | ) |
||
44 | ) { |
||
45 | 1 | $invalidNumbers[] = $phoneNumber; |
|
46 | } |
||
47 | |||
48 | } |
||
49 | |||
50 | 1 | return count($invalidNumbers) === 0; |
|
51 | } |
||
52 | } |
||
53 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.