Passed
Push — develop ( 0a2c3f...8e5858 )
by Alec
03:05
created

BenchmarkFields::isShowReturns()   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 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace AlecRabbit\Tools\Traits;
4
5
use AlecRabbit\Accessories\MemoryUsage\MemoryUsageReport;
6
use AlecRabbit\Tools\Internal\BenchmarkFunction;
7
use AlecRabbit\Tools\SimpleCounter;
8
use AlecRabbit\Tools\Timer;
9
10
trait BenchmarkFields
11
{
12
    /** @var BenchmarkFunction[] */
13
    protected $functions = [];
14
15
    /** @var MemoryUsageReport */
16
    protected $memoryUsageReport;
17
18
    /** @var int */
19
    protected $doneIterations = 0;
20
21
    /** @var int */
22
    protected $doneIterationsCombined = 0;
23
24
    /** @var Timer */
25
    protected $timer;
26
27
    /** @var SimpleCounter */
28
    protected $added;
29
30
    /** @var SimpleCounter */
31
    protected $benchmarked;
32
33
    /** @var bool */
34
    protected $showReturns = false;
35
36
    /**
37
     * @return BenchmarkFunction[]
38
     */
39 16
    public function getFunctions(): array
40
    {
41 16
        return $this->functions;
42
    }
43
44
    /**
45
     * @return int
46
     */
47 16
    public function getDoneIterations(): int
48
    {
49 16
        return $this->doneIterations;
50
    }
51
52
    /**
53
     * @return Timer
54
     */
55 16
    public function getTimer(): Timer
56
    {
57 16
        return $this->timer;
58
    }
59
60
    /**
61
     * @return int
62
     */
63 16
    public function getDoneIterationsCombined(): int
64
    {
65 16
        return $this->doneIterationsCombined;
66
    }
67
68
    /**
69
     * @return MemoryUsageReport
70
     */
71 16
    public function getMemoryUsageReport(): MemoryUsageReport
72
    {
73 16
        return $this->memoryUsageReport;
74
    }
75
76
    /**
77
     * @return SimpleCounter
78
     */
79 16
    public function getAdded(): SimpleCounter
80
    {
81 16
        return $this->added;
82
    }
83
84
    /**
85
     * @return SimpleCounter
86
     */
87 16
    public function getBenchmarked(): SimpleCounter
88
    {
89 16
        return $this->benchmarked;
90
    }
91
92
    /**
93
     * @return bool
94
     */
95 16
    public function isShowReturns(): bool
96
    {
97 16
        return $this->showReturns;
98
    }
99
100
    /**
101
     * @return bool
102
     */
103 8
    public function isNotShowReturns(): bool
104
    {
105 8
        return !$this->isShowReturns();
106
    }
107
}
108