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

@@ 195-206 (lines=12) @@
192
     * @param $startIndex
193
     * @return int|void
194
     */
195
    protected function skipNicknameParts($parts, $startIndex)
196
    {
197
        $total = count($parts);
198
199
        for ($i = $startIndex; $i < $total; $i++) {
200
            if (!($parts[$i] instanceof Nickname)) {
201
                return $i;
202
            }
203
        }
204
205
        return $total - 1;
206
    }
207
}
208