@@ -1,3 +1,3 @@ |
||
| 1 | 1 | <?php namespace Propaganistas\LaravelPhone\Exceptions; |
| 2 | 2 | |
| 3 | -class PhoneCountryException extends \Exception{} |
|
| 3 | +class PhoneCountryException extends \Exception {} |
|
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | { |
| 26 | 26 | $countries = is_array($countries) ? $countries : func_get_args(); |
| 27 | 27 | |
| 28 | - return array_filter($countries, function ($code) { |
|
| 28 | + return array_filter($countries, function($code) { |
|
| 29 | 29 | $code = strtoupper($code); |
| 30 | 30 | |
| 31 | 31 | return static::isCountryCode($code) ? $code : null; |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public static function isType($type) |
| 23 | 23 | { |
| 24 | - return ! is_null(static::parseTypes($type)); |
|
| 24 | + return !is_null(static::parseTypes($type)); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | $types = is_array($types) ? $types : func_get_args(); |
| 38 | 38 | |
| 39 | - return array_filter($types, function ($type) { |
|
| 39 | + return array_filter($types, function($type) { |
|
| 40 | 40 | // If the type equals a constant's value, just return it. |
| 41 | 41 | if (in_array($type, static::$types)) { |
| 42 | 42 | return $type; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | $types = is_array($types) ? $types : func_get_args(); |
| 61 | 61 | |
| 62 | - return array_filter($types, function ($type) { |
|
| 62 | + return array_filter($types, function($type) { |
|
| 63 | 63 | $type = strtoupper($type); |
| 64 | 64 | |
| 65 | 65 | // If the type equals a constant's name, just return it. |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | private static function loadTypes() |
| 80 | 80 | { |
| 81 | - if (! static::$types) { |
|
| 81 | + if (!static::$types) { |
|
| 82 | 82 | static::$types = with(new ReflectionClass(PhoneNumberType::class))->getConstants(); |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public static function isFormat($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 | } |
@@ -126,13 +126,13 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function format($format) |
| 128 | 128 | { |
| 129 | - if (! ($format = static::parseFormat($format))) { |
|
| 130 | - return $this->throwFormatException('Unknown format "' . (string) $format . '"'); |
|
| 129 | + if (!($format = static::parseFormat($format))) { |
|
| 130 | + return $this->throwFormatException('Unknown format "'.(string) $format.'"'); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | $country = Arr::get($this->countries, 0); |
| 134 | 134 | |
| 135 | - if (! $country && ! Str::startsWith($this->number, '+')) { |
|
| 135 | + if (!$country && !Str::startsWith($this->number, '+')) { |
|
| 136 | 136 | return $this->throwFormatException('A country should be provided or the number should be in international format'); |
| 137 | 137 | } |
| 138 | 138 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | public function formatForCountry($country) |
| 152 | 152 | { |
| 153 | - if (! static::isCountryCode($country)) { |
|
| 153 | + if (!static::isCountryCode($country)) { |
|
| 154 | 154 | return $this->throwCountryException($country); |
| 155 | 155 | } |
| 156 | 156 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | */ |
| 170 | 170 | public function formatForMobileDialingInCountry($country, $removeFormatting = false) |
| 171 | 171 | { |
| 172 | - if (! static::isCountryCode($country)) { |
|
| 172 | + if (!static::isCountryCode($country)) { |
|
| 173 | 173 | return $this->throwCountryException($country); |
| 174 | 174 | } |
| 175 | 175 | |