@@ -31,17 +31,17 @@ |
||
31 | 31 | */ |
32 | 32 | public function callPhoneValidator(): array |
33 | 33 | { |
34 | - $results = []; |
|
34 | + $results = [ ]; |
|
35 | 35 | |
36 | 36 | $codes = explode(',', $this->code); |
37 | 37 | |
38 | 38 | $codes = array_map('strtoupper', $codes); |
39 | 39 | |
40 | 40 | foreach ($codes as $code) { |
41 | - $methodName = 'validate' . $code; |
|
41 | + $methodName = 'validate'.$code; |
|
42 | 42 | |
43 | 43 | if (method_exists($this, $methodName)) { |
44 | - $results[$code] = $this->{$methodName}(); |
|
44 | + $results[ $code ] = $this->{$methodName}(); |
|
45 | 45 | } else { |
46 | 46 | throw new \BadMethodCallException("Validator method '{$methodName}' does not exist."); |
47 | 47 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | public function passes($attribute, $value) |
22 | 22 | { |
23 | 23 | if (is_string($this->code)) { |
24 | - $passes = (new CountryPhoneCallback($value, $this->code))->callPhoneValidator(); |
|
24 | + $passes = (new CountryPhoneCallback($value, $this->code))->callPhoneValidator(); |
|
25 | 25 | return collect($passes)->some(fn ($passe) => $passe); |
26 | 26 | } |
27 | 27 | return preg_match('/^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/', $value); |