Total Complexity | 13 |
Total Lines | 142 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
12 | trait TimerFields |
||
13 | { |
||
14 | use GettableName; |
||
15 | |||
16 | /** @var float */ |
||
17 | protected $previous; |
||
18 | |||
19 | /** @var float */ |
||
20 | protected $start; |
||
21 | |||
22 | /** @var float */ |
||
23 | protected $creation; |
||
24 | |||
25 | /** @var float */ |
||
26 | protected $elapsed; |
||
27 | |||
28 | /** @var bool */ |
||
29 | protected $stopped = false; |
||
30 | |||
31 | /** @var float */ |
||
32 | protected $currentValue; |
||
33 | |||
34 | /** @var float */ |
||
35 | protected $avgValue; |
||
36 | |||
37 | /** @var float */ |
||
38 | protected $minValue; |
||
39 | |||
40 | /** @var int */ |
||
41 | protected $minValueIteration = 0; |
||
42 | |||
43 | /** @var float */ |
||
44 | protected $maxValue; |
||
45 | |||
46 | /** @var int */ |
||
47 | protected $maxValueIteration = 0; |
||
48 | |||
49 | /** @var int */ |
||
50 | protected $count = 0; |
||
51 | |||
52 | /** |
||
53 | * @return bool |
||
54 | */ |
||
55 | 7 | public function isStopped(): bool |
|
58 | } |
||
59 | |||
60 | /** |
||
61 | * @return bool |
||
62 | */ |
||
63 | 4 | public function isNotStopped(): bool |
|
64 | { |
||
65 | 4 | return !$this->stopped; |
|
66 | } |
||
67 | |||
68 | /** |
||
69 | * @return float |
||
70 | */ |
||
71 | 8 | public function getLastValue(): float |
|
72 | { |
||
73 | 8 | return $this->currentValue; |
|
74 | } |
||
75 | |||
76 | /** |
||
77 | * @return float |
||
78 | */ |
||
79 | 8 | public function getAverageValue(): float |
|
80 | { |
||
81 | 8 | return $this->avgValue; |
|
82 | } |
||
83 | |||
84 | /** |
||
85 | * @return float |
||
86 | */ |
||
87 | 3 | public function getMinValue(): float |
|
90 | } |
||
91 | |||
92 | /** |
||
93 | * @return float |
||
94 | */ |
||
95 | 8 | public function getMaxValue(): float |
|
96 | { |
||
97 | 8 | return $this->maxValue; |
|
98 | } |
||
99 | |||
100 | /** |
||
101 | * @return int |
||
102 | */ |
||
103 | 8 | public function getCount(): int |
|
104 | { |
||
105 | 8 | return $this->count; |
|
106 | } |
||
107 | |||
108 | /** |
||
109 | * @return int |
||
110 | */ |
||
111 | 7 | public function getMinValueIteration(): int |
|
112 | { |
||
113 | 7 | return $this->minValueIteration; |
|
114 | } |
||
115 | |||
116 | /** |
||
117 | * @return int |
||
118 | */ |
||
119 | 7 | public function getMaxValueIteration(): int |
|
120 | { |
||
121 | 7 | return $this->maxValueIteration; |
|
122 | } |
||
123 | |||
124 | /** |
||
125 | * @return float |
||
126 | */ |
||
127 | 10 | public function getElapsed(): float |
|
128 | { |
||
129 | 10 | return $this->elapsed; |
|
130 | } |
||
131 | |||
132 | /** |
||
133 | * @return float |
||
134 | */ |
||
135 | 7 | public function getCreation(): float |
|
138 | } |
||
139 | |||
140 | /** |
||
141 | * @return float |
||
142 | */ |
||
143 | 7 | public function getPrevious(): float |
|
144 | { |
||
145 | 7 | return $this->previous; |
|
146 | } |
||
147 | |||
148 | /** |
||
149 | * @return float |
||
150 | */ |
||
151 | 7 | public function getStart(): float |
|
154 | } |
||
155 | } |
||
156 |