Code Duplication    Length = 7-16 lines in 2 locations

lib/Elastica/Aggregation/AbstractSimpleAggregation.php 1 location

@@ 46-52 (lines=7) @@
43
44
        $baseName = $this->_getBaseName();
45
46
        if (isset($array[$baseName]['script']) && is_array($array[$baseName]['script'])) {
47
            $script = $array[$baseName]['script'];
48
49
            unset($array[$baseName]['script']);
50
51
            $array[$baseName] = array_merge($array[$baseName], $script);
52
        }
53
54
        return $array;
55
    }

lib/Elastica/Suggest/Phrase.php 1 location

@@ 170-185 (lines=16) @@
167
168
        $baseName = $this->_getBaseName();
169
170
        if (isset($array[$baseName]['candidate_generator'])) {
171
            $generator = $array[$baseName]['candidate_generator'];
172
            unset($array[$baseName]['candidate_generator']);
173
174
            $keys = array_keys($generator);
175
            $values = array_values($generator);
176
177
            $array[$baseName][$keys[0]][] = $values[0];
178
        }
179
180
        return $array;
181
    }
182
}
183