Code Duplication    Length = 10-10 lines in 2 locations

src/drop.php 1 location

@@ 10-19 (lines=10) @@
7
 *
8
 * @return mixed
9
 */
10
function drop()
11
{
12
    $args = func_get_args();
13
14
    $drop = function ($n, array $ls) {
15
        return array_slice($ls, $n);
16
    };
17
18
    return call_user_func_array(partial($drop), $args);
19
}
20

src/take.php 1 location

@@ 10-19 (lines=10) @@
7
 *
8
 * @return mixed
9
 */
10
function take()
11
{
12
    $args = func_get_args();
13
14
    $take = function ($n, array $ls) {
15
        return array_slice($ls, 0, $n);
16
    };
17
18
    return call_user_func_array(partial($take), $args);
19
}
20