| @@ 85-96 (lines=12) @@ | ||
| 82 | $this->subscriber_code = $this->extractSubscriberCode(); |
|
| 83 | } |
|
| 84 | ||
| 85 | protected function extractAreaCode() |
|
| 86 | { |
|
| 87 | if($this->region === 'US' && $this->isValid()){ |
|
| 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){ |
|
| 91 | return $matches[2]; |
|
| 92 | } |
|
| 93 | } |
|
| 94 | ||
| 95 | return null; |
|
| 96 | } |
|
| 97 | ||
| 98 | protected function extractSubscriberCode() |
|
| 99 | { |
|
| @@ 98-109 (lines=12) @@ | ||
| 95 | return null; |
|
| 96 | } |
|
| 97 | ||
| 98 | protected function extractSubscriberCode() |
|
| 99 | { |
|
| 100 | if($this->region === 'US' && $this->isValid()){ |
|
| 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]; |
|
| 105 | } |
|
| 106 | } |
|
| 107 | ||
| 108 | return null; |
|
| 109 | } |
|
| 110 | ||
| 111 | /*===================================== |
|
| 112 | = Ouput Methods = |
|