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