@@ -10,6 +10,6 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | public static function invalid($country) |
| 12 | 12 | { |
| 13 | - return new static('Invalid country code "' . $country . '".'); |
|
| 13 | + return new static('Invalid country code "'.$country.'".'); |
|
| 14 | 14 | } |
| 15 | 15 | } |
@@ -10,6 +10,6 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | public static function invalid($format) |
| 12 | 12 | { |
| 13 | - return new static('Invalid number format "' . $format . '".'); |
|
| 13 | + return new static('Invalid number format "'.$format.'".'); |
|
| 14 | 14 | } |
| 15 | 15 | } |
| 16 | 16 | \ No newline at end of file |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | use Propaganistas\LaravelPhone\PhoneNumber; |
| 4 | 4 | |
| 5 | -if (! function_exists('phone')) { |
|
| 5 | +if (!function_exists('phone')) { |
|
| 6 | 6 | /** |
| 7 | 7 | * Get a PhoneNumber instance or a formatted string. |
| 8 | 8 | * |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | { |
| 16 | 16 | $phone = PhoneNumber::make($number, $country); |
| 17 | 17 | |
| 18 | - if (! is_null($format)) { |
|
| 18 | + if (!is_null($format)) { |
|
| 19 | 19 | return $phone->format($format); |
| 20 | 20 | } |
| 21 | 21 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function register() |
| 31 | 31 | { |
| 32 | - $this->app->singleton('libphonenumber', function ($app) { |
|
| 32 | + $this->app->singleton('libphonenumber', function($app) { |
|
| 33 | 33 | return PhoneNumberUtil::getInstance(); |
| 34 | 34 | }); |
| 35 | 35 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | $extend = static::canUseDependentValidation() ? 'extendDependent' : 'extend'; |
| 45 | 45 | |
| 46 | - $this->app['validator']->{$extend}('phone', Validation\Phone::class . '@validate'); |
|
| 46 | + $this->app['validator']->{$extend}('phone', Validation\Phone::class.'@validate'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | protected function registerRule() |
| 53 | 53 | { |
| 54 | 54 | if (class_exists('Illuminate\Validation\Rule') && class_uses(Rule::class, Macroable::class)) { |
| 55 | - Rule::macro('phone', function () { |
|
| 55 | + Rule::macro('phone', function() { |
|
| 56 | 56 | return new Rules\Phone; |
| 57 | 57 | }); |
| 58 | 58 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | $phoneNumber = PhoneNumber::make($value, $country); |
| 62 | 62 | |
| 63 | 63 | // Type validation. |
| 64 | - if (! empty($types) && ! $phoneNumber->isOfType($types)) { |
|
| 64 | + if (!empty($types) && !$phoneNumber->isOfType($types)) { |
|
| 65 | 65 | continue; |
| 66 | 66 | } |
| 67 | 67 | |
@@ -25,10 +25,10 @@ |
||
| 25 | 25 | protected function parseCountries($countries) |
| 26 | 26 | { |
| 27 | 27 | return Collection::make(is_array($countries) ? $countries : func_get_args()) |
| 28 | - ->map(function ($country) { |
|
| 28 | + ->map(function($country) { |
|
| 29 | 29 | return strtoupper($country); |
| 30 | 30 | }) |
| 31 | - ->filter(function ($value) { |
|
| 31 | + ->filter(function($value) { |
|
| 32 | 32 | return static::isValidCountryCode($value); |
| 33 | 33 | })->toArray(); |
| 34 | 34 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public static function isValidFormat($format) |
| 23 | 23 | { |
| 24 | - return ! is_null(static::parseFormat($format)); |
|
| 24 | + return !is_null(static::parseFormat($format)); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | private static function loadFormats() |
| 50 | 50 | { |
| 51 | - if (! static::$formats) { |
|
| 51 | + if (!static::$formats) { |
|
| 52 | 52 | static::$formats = with(new ReflectionClass(PhoneNumberFormat::class))->getConstants(); |
| 53 | 53 | } |
| 54 | 54 | } |
@@ -12,6 +12,6 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public static function ambiguous($parameter) |
| 14 | 14 | { |
| 15 | - return new static('Ambiguous phone validation parameter: "' . $parameter . '". This parameter is recognized as an input field and as a phone type. Please rename the input field.'); |
|
| 15 | + return new static('Ambiguous phone validation parameter: "'.$parameter.'". This parameter is recognized as an input field and as a phone type. Please rename the input field.'); |
|
| 16 | 16 | } |
| 17 | 17 | } |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | |
| 47 | 47 | $exception = new static( |
| 48 | 48 | libNumberParseException::INVALID_COUNTRY_CODE, |
| 49 | - 'Number does not match the provided '. Str::plural('country', count($countries)).'.' |
|
| 49 | + 'Number does not match the provided '.Str::plural('country', count($countries)).'.' |
|
| 50 | 50 | ); |
| 51 | 51 | |
| 52 | 52 | $exception->number = $number; |