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