Passed
Push — develop ( aa265d...8b49d6 )
by Alec
14:04
created

BenchmarkRelative::getRank()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace AlecRabbit\Tools\Internal;
4
5
use AlecRabbit\Tools\BenchmarkResult;
6
7
class BenchmarkRelative
8
{
9
    /** @var int */
10
    private $rank;
11
12
    /** @var float */
13
    private $relative;
14
15
    /** @var null|BenchmarkResult */
16
    private $benchmarkResult;
17
18
    /**
19
     * BenchmarkRelative constructor.
20
     * @param int $rank
21
     * @param float $relative
22
     * @param null|BenchmarkResult $result
23
     */
24
    public function __construct(int $rank, float $relative, ?BenchmarkResult $result)
25
    {
26
        $this->rank = $rank;
27
        $this->relative = $relative;
28
        $this->benchmarkResult = $result;
29
    }
30
31
    /**
32
     * @return int
33
     */
34
    public function getRank(): int
35
    {
36
        return $this->rank;
37
    }
38
39
    /**
40
     * @return float
41
     */
42
    public function getRelative(): float
43
    {
44
        return $this->relative;
45
    }
46
47
    /**
48
     * @return null|BenchmarkResult
49
     */
50
    public function getBenchmarkResult(): ?BenchmarkResult
51
    {
52
        return $this->benchmarkResult;
53
    }
54
}
55