Passed
Push — master ( a17677...390227 )
by Claudio
02:22
created

SignedIntResult::isGreater()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Budgegeria\IntlSort\Comparator;
6
7
class SignedIntResult implements Result
8
{
9
    /**
10
     * @var int
11
     */
12
    private $compareResult;
13
14 4
    public function __construct(int $compareResult)
15
    {
16 4
        $this->compareResult = $compareResult;
17 4
    }
18
19 4
    public function isSame(): bool
20
    {
21 4
        return $this->compareResult === 0;
22
    }
23
24 3
    public function isGreater(): bool
25
    {
26 3
        return $this->compareResult === 1;
27
    }
28
29 3
    public function isLess(): bool
30
    {
31 3
        return $this->compareResult === -1;
32
    }
33
}