Code Duplication    Length = 8-8 lines in 3 locations

src/object.php 2 locations

@@ 26-33 (lines=8) @@
23
 * @param  array $array
24
 * @return mixed
25
 */
26
function value() {
27
    $value = function($name, $array){
28
        return ('Object' == type($array))
29
            ? $array->{$name}
30
            : $array[$name];
31
    };
32
    return apply(curry($value), func_get_args());
33
}
34
35
/**
36
 * Checks if the given array or object has a specific key or public attribute.
@@ 59-66 (lines=8) @@
56
 * @param  array $array
57
 * @return mixed
58
 */
59
function has() {
60
    $has = function($name, $array){
61
        return ('Object' == type($array))
62
            ? isset($array->{$name})
63
            : isset($array[$name]);
64
    };
65
    return apply(curry($has), func_get_args());
66
}
67
68
/**
69
 * Checks if an attribute or value of an object or

src/string.php 1 location

@@ 232-239 (lines=8) @@
229
 * @param  string $string
230
 * @return array
231
 */
232
function match() {
233
    $match = function($pattern, $string) {
234
        $results = [];
235
        preg_match_all($pattern, $string, $results);
236
        return $results[0];
237
    };
238
    return apply(curry($match), func_get_args());
239
}
240
241
/**
242
 * Curried version of `substr_count` with changed order of parameters,