Code Duplication    Length = 12-12 lines in 2 locations

src/Telephone.php 2 locations

@@ 87-98 (lines=12) @@
84
        $this->subscriber_code = $this->extractSubscriberCode();
85
    }
86
87
    protected function extractAreaCode()
88
    {
89
        if($this->region === 'US' && $this->isValid()){
90
            $exp = '/^\+?(1)?\s?\(?(\d{3})\)?(?:\s|\.|\-)?(\d{3})(?:\s|\.|\-)?(\d{4})$/';
91
            preg_match($exp,$this->format_E164,$matches);
92
            if(count($matches) === 5){
93
                return $matches[2];
94
            }
95
        }
96
97
        return null;
98
    }
99
100
    protected function extractSubscriberCode()
101
    {
@@ 100-111 (lines=12) @@
97
        return null;
98
    }
99
100
    protected function extractSubscriberCode()
101
    {
102
        if($this->region === 'US' && $this->isValid()){
103
            $exp = '/^\+?(1)?\s?\(?(\d{3})\)?(?:\s|\.|\-)?(\d{3})(?:\s|\.|\-)?(\d{4})$/';
104
            preg_match($exp,$this->format_E164,$matches);
105
            if(count($matches) === 5){
106
                return $matches[3] . $matches[4];
107
            }
108
        }
109
110
        return null;
111
    }
112
113
    /*=====================================
114
    =            Ouput Methods            =