@@ -60,13 +60,13 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function boot(): void |
62 | 62 | { |
63 | - $countries = config('laravel-validate.phone-country', []); |
|
63 | + $countries = config('laravel-validate.phone-country', [ ]); |
|
64 | 64 | |
65 | 65 | foreach ($countries as $code => $country) { |
66 | 66 | CountryPhoneCallback::addValidator($code, $country); |
67 | 67 | } |
68 | 68 | |
69 | - $landlineCountries = config('laravel-validate.landline-country', []); |
|
69 | + $landlineCountries = config('laravel-validate.landline-country', [ ]); |
|
70 | 70 | |
71 | 71 | foreach ($landlineCountries as $code => $country) { |
72 | 72 | CountryLandlineCallback::addValidator($code, $country); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | Validator::extend( |
83 | 83 | $rule->getFilenameWithoutExtension(), |
84 | - function ($attribute, $value, $parameters, $validator) use ($className) { |
|
84 | + function($attribute, $value, $parameters, $validator) use ($className) { |
|
85 | 85 | return (new $className($parameters))->passes($attribute, $value); |
86 | 86 | } |
87 | 87 | ); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | /** |
11 | 11 | * Country Validate classes. |
12 | 12 | */ |
13 | - protected static array $validators = []; |
|
13 | + protected static array $validators = [ ]; |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * Add new country validator. |
@@ -19,11 +19,11 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public static function addValidator(string $code, string $validator): void |
21 | 21 | { |
22 | - if (! new $validator instanceof CountryLandlineValidator) { |
|
22 | + if ( ! new $validator instanceof CountryLandlineValidator) { |
|
23 | 23 | throw new RuntimeException('The validator is not instance of CountryLandlineValidator'); |
24 | 24 | } |
25 | 25 | |
26 | - self::$validators[$code] = $validator; |
|
26 | + self::$validators[ $code ] = $validator; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public static function callLandlineValidator(string $code, $value) |
33 | 33 | { |
34 | - if (isset(self::$validators[$code])) { |
|
35 | - return (new self::$validators[$code])->validate($value); |
|
34 | + if (isset(self::$validators[ $code ])) { |
|
35 | + return (new self::$validators[ $code ])->validate($value); |
|
36 | 36 | } else { |
37 | 37 | throw new \BadMethodCallException("Validator method for '$code' does not exist."); |
38 | 38 | } |