Code Duplication    Length = 12-12 lines in 2 locations

src/Base.php 2 locations

@@ 132-143 (lines=12) @@
129
        }
130
    }
131
132
    protected function getStateAbbreviations($country = null)
133
    {
134
        $x = [];
135
        foreach ($this->states as $c => $states) {
136
            if ($country === null || $c === $country) {
137
                foreach ($states as $state) {
138
                    $x[] = $state['abbr'];
139
                }
140
            }
141
        }
142
        return $x;
143
    }
144
145
    protected function getStateNames($country = null)
146
    {
@@ 145-156 (lines=12) @@
142
        return $x;
143
    }
144
145
    protected function getStateNames($country = null)
146
    {
147
        $x = [];
148
        foreach ($this->states as $c => $states) {
149
            if ($country === null || $c === $country) {
150
                foreach ($states as $state) {
151
                    $x[] = $state['name'];
152
                }
153
            }
154
        }
155
        return $x;
156
    }
157
158
    /**
159
     * Determine if the validation rule passes.