@@ -37,7 +37,7 @@ |
||
| 37 | 37 | * Country mismatch static constructor. |
| 38 | 38 | * |
| 39 | 39 | * @param string $number |
| 40 | - * @param string|array $country |
|
| 40 | + * @param string|array $countries |
|
| 41 | 41 | * @return static |
| 42 | 42 | */ |
| 43 | 43 | public static function countryMismatch($number, $countries) |
@@ -5,69 +5,69 @@ |
||
| 5 | 5 | |
| 6 | 6 | class NumberParseException extends libNumberParseException |
| 7 | 7 | { |
| 8 | - /** |
|
| 9 | - * @var string |
|
| 10 | - */ |
|
| 11 | - protected $number; |
|
| 8 | + /** |
|
| 9 | + * @var string |
|
| 10 | + */ |
|
| 11 | + protected $number; |
|
| 12 | 12 | |
| 13 | - /** |
|
| 14 | - * @var array |
|
| 15 | - */ |
|
| 16 | - protected $countries = []; |
|
| 13 | + /** |
|
| 14 | + * @var array |
|
| 15 | + */ |
|
| 16 | + protected $countries = []; |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Country specification required static constructor. |
|
| 20 | - * |
|
| 21 | - * @param string $number |
|
| 22 | - * @return static |
|
| 23 | - */ |
|
| 24 | - public static function countryRequired($number) |
|
| 25 | - { |
|
| 26 | - $exception = new static( |
|
| 27 | - libNumberParseException::INVALID_COUNTRY_CODE, |
|
| 28 | - 'Number requires a country to be specified.' |
|
| 29 | - ); |
|
| 18 | + /** |
|
| 19 | + * Country specification required static constructor. |
|
| 20 | + * |
|
| 21 | + * @param string $number |
|
| 22 | + * @return static |
|
| 23 | + */ |
|
| 24 | + public static function countryRequired($number) |
|
| 25 | + { |
|
| 26 | + $exception = new static( |
|
| 27 | + libNumberParseException::INVALID_COUNTRY_CODE, |
|
| 28 | + 'Number requires a country to be specified.' |
|
| 29 | + ); |
|
| 30 | 30 | |
| 31 | - $exception->number = $number; |
|
| 31 | + $exception->number = $number; |
|
| 32 | 32 | |
| 33 | - return $exception; |
|
| 34 | - } |
|
| 33 | + return $exception; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * Country mismatch static constructor. |
|
| 38 | - * |
|
| 39 | - * @param string $number |
|
| 40 | - * @param string|array $country |
|
| 41 | - * @return static |
|
| 42 | - */ |
|
| 43 | - public static function countryMismatch($number, $countries) |
|
| 44 | - { |
|
| 45 | - $countries = array_filter(is_array($countries) ? $countries : [$countries]); |
|
| 36 | + /** |
|
| 37 | + * Country mismatch static constructor. |
|
| 38 | + * |
|
| 39 | + * @param string $number |
|
| 40 | + * @param string|array $country |
|
| 41 | + * @return static |
|
| 42 | + */ |
|
| 43 | + public static function countryMismatch($number, $countries) |
|
| 44 | + { |
|
| 45 | + $countries = array_filter(is_array($countries) ? $countries : [$countries]); |
|
| 46 | 46 | |
| 47 | - $exception = new static( |
|
| 48 | - libNumberParseException::INVALID_COUNTRY_CODE, |
|
| 49 | - 'Number does not match the provided '. Str::plural('country', count($countries)).'.' |
|
| 50 | - ); |
|
| 47 | + $exception = new static( |
|
| 48 | + libNumberParseException::INVALID_COUNTRY_CODE, |
|
| 49 | + 'Number does not match the provided '. Str::plural('country', count($countries)).'.' |
|
| 50 | + ); |
|
| 51 | 51 | |
| 52 | - $exception->number = $number; |
|
| 53 | - $exception->countries = $countries; |
|
| 52 | + $exception->number = $number; |
|
| 53 | + $exception->countries = $countries; |
|
| 54 | 54 | |
| 55 | - return $exception; |
|
| 56 | - } |
|
| 55 | + return $exception; |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - /** |
|
| 59 | - * @return string |
|
| 60 | - */ |
|
| 61 | - public function getNumber() |
|
| 62 | - { |
|
| 63 | - return $this->number; |
|
| 64 | - } |
|
| 58 | + /** |
|
| 59 | + * @return string |
|
| 60 | + */ |
|
| 61 | + public function getNumber() |
|
| 62 | + { |
|
| 63 | + return $this->number; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * @return array |
|
| 68 | - */ |
|
| 69 | - public function getCountries() |
|
| 70 | - { |
|
| 71 | - return $this->countries; |
|
| 72 | - } |
|
| 66 | + /** |
|
| 67 | + * @return array |
|
| 68 | + */ |
|
| 69 | + public function getCountries() |
|
| 70 | + { |
|
| 71 | + return $this->countries; |
|
| 72 | + } |
|
| 73 | 73 | } |
| 74 | 74 | \ No newline at end of file |
@@ -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; |
@@ -4,14 +4,14 @@ |
||
| 4 | 4 | |
| 5 | 5 | class InvalidParameterException extends \Exception |
| 6 | 6 | { |
| 7 | - /** |
|
| 8 | - * Ambiguous parameter static constructor. |
|
| 9 | - * |
|
| 10 | - * @param string $parameter |
|
| 11 | - * @return static |
|
| 12 | - */ |
|
| 13 | - public static function ambiguous($parameter) |
|
| 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.'); |
|
| 16 | - } |
|
| 7 | + /** |
|
| 8 | + * Ambiguous parameter static constructor. |
|
| 9 | + * |
|
| 10 | + * @param string $parameter |
|
| 11 | + * @return static |
|
| 12 | + */ |
|
| 13 | + public static function ambiguous($parameter) |
|
| 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.'); |
|
| 16 | + } |
|
| 17 | 17 | } |
@@ -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 | } |