Passed
Push — develop ( 4c7784...9c7d33 )
by Alec
03:41 queued 10s
created

BenchmarkFields::isWithResults()   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 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * User: alec
4
 * Date: 01.12.18
5
 * Time: 20:33
6
 */
7
8
namespace AlecRabbit\Tools\Traits;
9
10
use AlecRabbit\Tools\Profiler;
11
use AlecRabbit\Tools\Timer;
12
13
trait BenchmarkFields
14
{
15
    /** @var array */
16
    protected $functions = [];
17
18
    /** @var Profiler */
19
    protected $profiler;
20
21
    /** @var int */
22
    protected $doneIterations = 0;
23
24
    /** @var Timer */
25
    private $timer;
26
27
28
    /**
29
     * Resets fields
30
     */
31 4
    protected function resetFields(): void
32
    {
33 4
        $this->functions = [];
34 4
        $this->profiler = new Profiler();
35 4
    }
36
37
    /**
38
     * @return array
39
     */
40 3
    public function getFunctions(): array
41
    {
42 3
        return $this->functions;
43
    }
44
45
    /**
46
     * @return Profiler
47
     */
48 3
    public function getProfiler(): Profiler
49
    {
50 3
        return $this->profiler;
51
    }
52
53
    /**
54
     * @return int
55
     */
56 3
    public function getDoneIterations(): int
57
    {
58 3
        return $this->doneIterations;
59
    }
60
61
    /**
62
     * @return Timer
63
     */
64 1
    public function getTimer(): Timer
65
    {
66 1
        return $this->timer;
67
    }
68
}
69