Code Duplication    Length = 7-7 lines in 11 locations

src/math.php 2 locations

@@ 191-197 (lines=7) @@
188
 * @param  number $b
189
 * @return number
190
 */
191
function min() {
192
    static $min = false;
193
    $min = $min ?: curry(function($a, $b){
194
        return $a < $b ? $a : $b;
195
    });
196
    return _apply($min, func_get_args());
197
}
198
199
/**
200
 * Computes the minimum of two elements using a function.
@@ 236-242 (lines=7) @@
233
 * @param  number $b
234
 * @return number
235
 */
236
function max() {
237
    static $max = false;
238
    $max = $max ?: curry(function($a, $b){
239
        return $a > $b ? $a : $b;
240
    });
241
    return _apply($max, func_get_args());
242
}
243
244
/**
245
 * Computes the maximum of two elements using a function.

src/operators.php 9 locations

@@ 23-29 (lines=7) @@
20
 * @param  bool $b
21
 * @return bool
22
 */
23
function and_() {
24
    static $and = false;
25
    $and = $and ?: curry(function($a, $b){
26
        return $a && $b;
27
    });
28
    return _apply($and, func_get_args());
29
}
30
31
/**
32
 * Returns `$a || $b`.
@@ 46-52 (lines=7) @@
43
 * @param  bool $b
44
 * @return bool
45
 */
46
function or_() {
47
    static $or = false;
48
    $or = $or ?: curry(function($a, $b){
49
        return $a || $b;
50
    });
51
    return _apply($or, func_get_args());
52
}
53
54
/**
55
 * Returns `!$x`.
@@ 107-113 (lines=7) @@
104
 * @param  mixed $b
105
 * @return bool
106
 */
107
function notEq() {
108
    static $notEq = false;
109
    $notEq = $notEq ?: curry(function($a, $b){
110
        return $a != $b;
111
    });
112
    return _apply($notEq, func_get_args());
113
}
114
115
/**
116
 * Returns `$x === $y`.
@@ 127-133 (lines=7) @@
124
 * @param  mixed $b
125
 * @return bool
126
 */
127
function eqq() {
128
    static $eqq = false;
129
    $eqq = $eqq ?: curry(function($a, $b){
130
        return $a === $b;
131
    });
132
    return _apply($eqq, func_get_args());
133
}
134
135
/**
136
 * Returns `$x !== $y`.
@@ 148-154 (lines=7) @@
145
 * @param  mixed $b
146
 * @return bool
147
 */
148
function notEqq() {
149
    static $notEqq = false;
150
    $notEqq = $notEqq ?: curry(function($a, $b){
151
        return $a !== $b;
152
    });
153
    return _apply($notEqq, func_get_args());
154
}
155
156
/**
157
 * Returns `true` if the two elements have the same type and are deeply equivalent.
@@ 253-259 (lines=7) @@
250
 * @param  mixed $b
251
 * @return bool
252
 */
253
function lt() {
254
    static $lt = false;
255
    $lt = $lt ?: curry(function($a, $b){
256
        return $a < $b;
257
    });
258
    return _apply($lt, func_get_args());
259
}
260
261
/**
262
 * Returns `$a <= $b`.
@@ 275-281 (lines=7) @@
272
 * @param  mixed $b
273
 * @return bool
274
 */
275
function lte() {
276
    static $lte = false;
277
    $lte = $lte ?: curry(function($a, $b){
278
        return $a <= $b;
279
    });
280
    return _apply($lte, func_get_args());
281
}
282
283
/**
284
 * Returns `$a > $b`.
@@ 297-303 (lines=7) @@
294
 * @param  mixed $b
295
 * @return bool
296
 */
297
function gt() {
298
    static $gt = false;
299
    $gt = $gt ?: curry(function($a, $b){
300
        return $a > $b;
301
    });
302
    return _apply($gt, func_get_args());
303
}
304
305
/**
306
 * Returns `$a >= $b`.
@@ 319-325 (lines=7) @@
316
 * @param  mixed $b
317
 * @return bool
318
 */
319
function gte() {
320
    static $gte = false;
321
    $gte = $gte ?: curry(function($a, $b){
322
        return $a >= $b;
323
    });
324
    return _apply($gte, func_get_args());
325
}
326
327