Code Duplication    Length = 13-13 lines in 2 locations

src/Service/Search.php 1 location

@@ 183-195 (lines=13) @@
180
     *
181
     * @return string
182
     */
183
    protected function getNameForLocale($locale, &$names)
184
    {
185
        if (isset($names[$locale][1])) {
186
            $name = $names[$locale][1];
187
            unset($names[$locale][1]);
188
        } elseif (isset($names[$locale][4])) {
189
            $name = $names[$locale][4];
190
            unset($names[$locale][4]);
191
        } else {
192
            $name = array_shift($names[$locale]);
193
        }
194
195
        return $name;
196
    }
197
}
198

src/Service/Filler.php 1 location

@@ 443-455 (lines=13) @@
440
     *
441
     * @return string
442
     */
443
    protected function getNameForLocale($locale, &$names)
444
    {
445
        if (isset($names[$locale]['main'])) {
446
            $name = $names[$locale]['main'];
447
            unset($names[$locale]['main']);
448
        } elseif (isset($names[$locale]['official'])) {
449
            $name = $names[$locale]['official'];
450
            unset($names[$locale]['official']);
451
        } else {
452
            $name = array_shift($names[$locale]);
453
        }
454
455
        return $name;
456
    }
457
458
    /**