Passed
Push — master ( 0355ae...892a45 )
by Radosław
02:04
created

()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace phln\math;
5
6
use function phln\fn\curryN;
7
8
const modulo = '\\phln\\math\\modulo';
9
const 𝑓modulo = '\\phln\\math\\𝑓modulo';
10
11
/**
12
 * Divides the first parameter by the second and returns the remainder.
13
 *
14
 * @phlnSignature Number a => a -> a -> a
15
 * @phlnCategory math
16
 * @param string $a
17
 * @param string $b
18
 * @return \Closure|mixed
19
 * @example
20
 *      \\phln\\math\\modulo(1, 2) // 1
21
 */
22
function modulo($a = null, $b = null)
23
{
24
    return curryN(2, 𝑓modulo, func_get_args());
25
}
26
27
function 𝑓modulo($a, $b)
28
{
29
    return $a % $b;
30
}
31