Code Duplication    Length = 12-12 lines in 2 locations

src/Mapper/AbstractMapper.php 1 location

@@ 45-56 (lines=12) @@
42
     * @param array $parts
43
     * @return int|bool
44
     */
45
    protected function findFirstMapped(string $type, array $parts)
46
    {
47
        $total = count($parts);
48
49
        for ($i = 0; $i < $total; $i++) {
50
            if ($parts[$i] instanceof $type) {
51
                return $i;
52
            }
53
        }
54
55
        return false;
56
    }
57
58
    /**
59
     * get the registry lookup key for the given word

src/Mapper/LastnameMapper.php 1 location

@@ 232-243 (lines=12) @@
229
     * @param $startIndex
230
     * @return int|void
231
     */
232
    protected function skipNicknameParts($parts, $startIndex)
233
    {
234
        $total = count($parts);
235
236
        for ($i = $startIndex; $i < $total; $i++) {
237
            if (!($parts[$i] instanceof Nickname)) {
238
                return $i;
239
            }
240
        }
241
242
        return $total - 1;
243
    }
244
}
245