Code Duplication    Length = 7-8 lines in 2 locations

src/Russian/CardinalNumeral.php 1 location

@@ 257-264 (lines=8) @@
254
            }
255
256
            // make one array with cases and delete 'o/об' prepositional from all parts except the last one
257
            foreach (array(self::IMENIT, self::RODIT, self::DAT, self::VINIT, self::TVORIT, self::PREDLOJ) as $case) {
258
                $result[$case] = array();
259
                foreach ($parts as $partN => $part) {
260
                    if ($case == self::PREDLOJ && $partN > 0) list(, $part[$case]) = explode(' ', $part[$case], 2);
261
                    $result[$case][] = $part[$case];
262
                }
263
                $result[$case] = implode(' ', $result[$case]);
264
            }
265
266
            return $result;
267
        }

src/Russian/functions.php 1 location

@@ 26-32 (lines=7) @@
23
            $name[1] = FirstNamesDeclension::getCases($name[1], $gender);
24
            $name[2] = MiddleNamesDeclension::getCases($name[2], $gender);
25
        }
26
        foreach (array(Cases::IMENIT, Cases::RODIT, Cases::DAT, Cases::VINIT, Cases::TVORIT, Cases::PREDLOJ) as $case) {
27
            foreach ($name as $partNum => $namePart) {
28
                if ($case == Cases::PREDLOJ && $partNum > 0) list(, $namePart[$case]) = explode(' ', $namePart[$case]);
29
                $result[$case][] = $namePart[$case];
30
            }
31
            $result[$case] = implode(' ', $result[$case]);
32
        }
33
        return $result;
34
    } else {
35
        $case = CasesHelper::canonizeCase($case);