Code Duplication    Length = 9-9 lines in 2 locations

src/list.php 2 locations

@@ 262-270 (lines=9) @@
259
 * @param  array|string $list
260
 * @return array
261
 */
262
function reverse () {
263
    static $reverse = false;
264
    $reverse = $reverse ?: curry(function($list) {
265
        return is_string($list)
266
            ? strrev($list)
267
            : array_reverse($list);
268
    });
269
    return _apply($reverse, func_get_args());
270
}
271
272
/**
273
 * Alias for `count()` and `strlen()`.
@@ 286-294 (lines=9) @@
283
 * @param  array|string $list
284
 * @return int
285
 */
286
function length() {
287
    static $length = false;
288
    $length = $length ?: curry(function($list) {
289
        return is_string($list)
290
            ? strlen($list)
291
            : count($list);
292
    });
293
    return _apply($length, func_get_args());
294
}
295
296
/**
297
 * Checks if the `$predicate` is verified by **all** items of the array.