Total Complexity | 8 |
Total Lines | 84 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
13 | trait BenchmarkFields |
||
14 | { |
||
15 | /** @var array */ |
||
16 | protected $functions = []; |
||
17 | /** @var Profiler */ |
||
18 | protected $profiler; |
||
19 | /** @var int */ |
||
20 | protected $doneIterations = 0; |
||
21 | /** @var bool */ |
||
22 | protected $withResults = false; |
||
23 | /** @var array */ |
||
24 | private $exceptionMessages = []; |
||
25 | /** @var array */ |
||
26 | private $exceptions = []; |
||
27 | /** @var Timer */ |
||
28 | private $timer; |
||
29 | |||
30 | 5 | ||
31 | /** |
||
32 | 5 | * Resets fields |
|
33 | 5 | */ |
|
34 | 5 | protected function resetFields(): void |
|
35 | 5 | { |
|
36 | 5 | $this->functions = []; |
|
37 | 5 | $this->profiler = new Profiler(); |
|
38 | $this->withResults = false; |
||
39 | $this->exceptionMessages = []; |
||
40 | $this->exceptions = []; |
||
41 | } |
||
42 | 4 | ||
43 | /** |
||
44 | 4 | * @return array |
|
45 | */ |
||
46 | public function getFunctions(): array |
||
47 | { |
||
48 | return $this->functions; |
||
49 | } |
||
50 | 4 | ||
51 | /** |
||
52 | 4 | * @return Profiler |
|
53 | */ |
||
54 | public function getProfiler(): Profiler |
||
55 | { |
||
56 | return $this->profiler; |
||
57 | } |
||
58 | 4 | ||
59 | /** |
||
60 | 4 | * @return int |
|
61 | */ |
||
62 | public function getDoneIterations(): int |
||
63 | { |
||
64 | return $this->doneIterations; |
||
65 | } |
||
66 | 4 | ||
67 | /** |
||
68 | 4 | * @return bool |
|
69 | */ |
||
70 | public function isWithResults(): bool |
||
71 | { |
||
72 | return $this->withResults; |
||
73 | } |
||
74 | 4 | ||
75 | /** |
||
76 | 4 | * @return array |
|
77 | */ |
||
78 | public function getExceptionMessages(): array |
||
79 | { |
||
80 | return $this->exceptionMessages; |
||
81 | } |
||
82 | 4 | ||
83 | /** |
||
84 | 4 | * @return array |
|
85 | */ |
||
86 | public function getExceptions(): array |
||
87 | { |
||
88 | return $this->exceptions; |
||
89 | } |
||
90 | |||
91 | /** |
||
92 | * @return Timer |
||
93 | */ |
||
94 | public function getTimer(): Timer |
||
97 | } |
||
98 | } |
||
99 |