@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * @param string $input The phone number |
51 | 51 | * @param string $region The region or country of the phone number |
52 | 52 | */ |
53 | - public function __construct($input,$region = 'US') |
|
53 | + public function __construct($input, $region = 'US') |
|
54 | 54 | { |
55 | 55 | $this->input = $input; |
56 | 56 | $this->region = $region; |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | |
85 | 85 | protected function extractAreaCode() |
86 | 86 | { |
87 | - if($this->region === 'US' && $this->isValid()){ |
|
87 | + if ($this->region === 'US' && $this->isValid()) { |
|
88 | 88 | $exp = '/^\+?(1)?\s?\(?(\d{3})\)?(?:\s|\.|\-)?(\d{3})(?:\s|\.|\-)?(\d{4})$/'; |
89 | - preg_match($exp,$this->format_E164,$matches); |
|
90 | - if(count($matches) === 5){ |
|
89 | + preg_match($exp, $this->format_E164, $matches); |
|
90 | + if (count($matches) === 5) { |
|
91 | 91 | return $matches[2]; |
92 | 92 | } |
93 | 93 | } |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | |
98 | 98 | protected function extractSubscriberCode() |
99 | 99 | { |
100 | - if($this->region === 'US' && $this->isValid()){ |
|
100 | + if ($this->region === 'US' && $this->isValid()) { |
|
101 | 101 | $exp = '/^\+?(1)?\s?\(?(\d{3})\)?(?:\s|\.|\-)?(\d{3})(?:\s|\.|\-)?(\d{4})$/'; |
102 | - preg_match($exp,$this->format_E164,$matches); |
|
103 | - if(count($matches) === 5){ |
|
104 | - return $matches[3] . $matches[4]; |
|
102 | + preg_match($exp, $this->format_E164, $matches); |
|
103 | + if (count($matches) === 5) { |
|
104 | + return $matches[3].$matches[4]; |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 |