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

@@ 213-224 (lines=12) @@
210
     * @param $startIndex
211
     * @return int|void
212
     */
213
    protected function skipNicknameParts($parts, $startIndex)
214
    {
215
        $total = count($parts);
216
217
        for ($i = $startIndex; $i < $total; $i++) {
218
            if (!($parts[$i] instanceof Nickname)) {
219
                return $i;
220
            }
221
        }
222
223
        return $total - 1;
224
    }
225
}
226