Code Duplication    Length = 8-9 lines in 2 locations

src/object.php 1 location

@@ 301-308 (lines=8) @@
298
 * @param  mixed $object
299
 * @return mixed
300
 */
301
function update() {
302
    static $update = false;
303
    $update = $update ?: curry(function($name, $fn, $object) {
304
        $value = get($name, $object);
305
        return (null === $value) ? $object : set($name, $fn($value), $object);
306
    });
307
    return _apply($update, func_get_args());
308
}
309
310
/**
311
 * Checks if an attribute/value of an object/array passes the given predicate.

src/list.php 1 location

@@ 410-418 (lines=9) @@
407
 * @param  array $list
408
 * @return array
409
 */
410
function insert() {
411
    static $insert = false;
412
    $insert = $insert ?: curry(function($position, $item, $list) {
413
        return (is_string($list))
414
            ? insertAll($position, $item, $list)
415
            : insertAll($position, [$item], $list);
416
    });
417
    return _apply($insert, func_get_args());
418
}
419
420
/**
421
 * Same as `insert` but inserts an array instead of a single item.