GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( d4aabe...dd418e )
by Dušan
03:32
created

utility_functions.php ➔ max()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 1
cts 1
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace DusanKasan\Knapsack;
4
5
/**
6
 * Returns its argument.
7
 *
8
 * @param mixed $value
9
 * @return mixed
10
 */
11
function identity($value)
12
{
13 1
    return $value;
14
}
15
16
/**
17
 * Comparator. Returns a negative number, zero, or a positive number when x is logically 'less than', 'equal to', or
18
 * 'greater than' y.
19
 *
20
 * @param mixed $a
21
 * @param mixed $b
22
 * @return int
23
 */
24
function compare($a, $b)
25
{
26 1
    if ($a == $b) {
27 1
        return 0;
28
    }
29
30 1
    return $a < $b ? -1 : 1;
31
}
32
33
/**
34
 * Increments $value by one.
35
 *
36
 * @param int $value
37
 * @return int
38
 */
39
function increment($value)
40
{
41 1
    return $value + 1;
42
}
43
44
/**
45
 * Decrements $value by one.
46
 *
47
 * @param int $value
48
 * @return int
49
 */
50
function decrement($value)
51
{
52 1
    return $value - 1;
53
}
54