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.

NumericComparison::isLesserThan()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 3
crap 2
1
<?php
2
3
namespace PhpAbac\Comparison;
4
5
class NumericComparison extends AbstractComparison
6
{
7
    /**
8
     * @param int $expected
9
     * @param int $value
10
     *
11
     * @return bool
12
     */
13 1
    public function isEqual($expected, $value)
14
    {
15 1
        return (int) $expected === (int) $value;
16
    }
17
18
    /**
19
     * If strict is set to false, equal values will return true.
20
     * 
21
     * @param int  $expected
22
     * @param int  $value
23
     * @param bool $strict
24
     *
25
     * @return bool
26
     */
27 1
    public function isLesserThan($expected, $value, $strict = true)
28
    {
29
        return
30 1
            ($strict === true)
31 1
            ? $expected > $value
32 1
            : $expected >= $value
33 1
        ;
34
    }
35
36
    /**
37
     * If strict is set to false, equal values will return true.
38
     * 
39
     * @param int  $expected
40
     * @param int  $value
41
     * @param bool $strict
42
     *
43
     * @return bool
44
     */
45 5
    public function isGreaterThan($expected, $value, $strict = true)
46
    {
47
        return
48 5
            ($strict === true)
49 5
            ? $expected < $value
50 1
            : $expected <= $value
51 5
        ;
52
    }
53
}
54