1 | <?php namespace Arcanedev\LaravelMetrics\Metrics\Concerns; |
||
12 | trait FormatsTrends |
||
13 | { |
||
14 | /* ----------------------------------------------------------------- |
||
15 | | Main Methods |
||
16 | | ----------------------------------------------------------------- |
||
17 | */ |
||
18 | |||
19 | /** |
||
20 | * Format aggregate key. |
||
21 | * |
||
22 | * @param \Cake\Chronos\Chronos $date |
||
23 | * @param string $unit |
||
24 | * |
||
25 | * @return string |
||
26 | */ |
||
27 | 8 | protected function formatAggregateKey(Chronos $date, string $unit): string |
|
49 | |||
50 | /** |
||
51 | * Format the label. |
||
52 | * |
||
53 | * @param \Cake\Chronos\Chronos $date |
||
54 | * @param string $unit |
||
55 | * @param bool $twelveHourTime |
||
56 | * |
||
57 | * @return string |
||
58 | */ |
||
59 | 8 | protected function formatLabelBy(Chronos $date, string $unit, bool $twelveHourTime = false): string |
|
81 | |||
82 | /* ----------------------------------------------------------------- |
||
83 | | Formatters |
||
84 | | ----------------------------------------------------------------- |
||
85 | */ |
||
86 | |||
87 | /** |
||
88 | * Format the given date by months. |
||
89 | * |
||
90 | * @param \Cake\Chronos\Chronos $date |
||
91 | * |
||
92 | * @return string |
||
93 | */ |
||
94 | protected function formatAggregateKeyByMonths(Chronos $date): string |
||
98 | |||
99 | /** |
||
100 | * Format the given date by weeks. |
||
101 | * |
||
102 | * @param \Cake\Chronos\Chronos $date |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | protected function formatAggregateKeyByWeeks(Chronos $date): string |
||
113 | |||
114 | /** |
||
115 | * Format the given date by days. |
||
116 | * |
||
117 | * @param \Cake\Chronos\Chronos $date |
||
118 | * |
||
119 | * @return string |
||
120 | */ |
||
121 | 8 | protected function formatAggregateKeyByDays(Chronos $date): string |
|
125 | |||
126 | /** |
||
127 | * Format the given date by hours. |
||
128 | * |
||
129 | * @param \Cake\Chronos\Chronos $date |
||
130 | * |
||
131 | * @return string |
||
132 | */ |
||
133 | protected function formatAggregateKeyByHours(Chronos $date): string |
||
137 | |||
138 | /** |
||
139 | * Format the given date by minutes. |
||
140 | * |
||
141 | * @param \Cake\Chronos\Chronos $date |
||
142 | * |
||
143 | * @return string |
||
144 | */ |
||
145 | protected function formatAggregateKeyByMinutes(Chronos $date): string |
||
149 | |||
150 | /** |
||
151 | * Get the label by Months. |
||
152 | * |
||
153 | * @param \Cake\Chronos\Chronos $date |
||
154 | * |
||
155 | * @return string |
||
156 | */ |
||
157 | protected function formatLabelByMonths(Chronos $date): string |
||
161 | |||
162 | /** |
||
163 | * Get the label by Weeks. |
||
164 | * |
||
165 | * @param \Cake\Chronos\Chronos $date |
||
166 | * |
||
167 | * @return string |
||
168 | */ |
||
169 | protected function formatLabelByWeeks(Chronos $date): string |
||
179 | |||
180 | /** |
||
181 | * Get the label by Days. |
||
182 | * |
||
183 | * @param \Cake\Chronos\Chronos $date |
||
184 | * |
||
185 | * @return string |
||
186 | */ |
||
187 | 8 | protected function formatLabelByDays(Chronos $date): string |
|
191 | |||
192 | /** |
||
193 | * Get the label by Hours. |
||
194 | * |
||
195 | * @param \Cake\Chronos\Chronos $date |
||
196 | * @param bool $twelveHourTime |
||
197 | * |
||
198 | * @return string |
||
199 | */ |
||
200 | protected function formatLabelByHours(Chronos $date, bool $twelveHourTime = false): string |
||
208 | |||
209 | /** |
||
210 | * Get the label by Minutes. |
||
211 | * |
||
212 | * @param \Cake\Chronos\Chronos $date |
||
213 | * @param bool $twelveHourTime |
||
214 | * |
||
215 | * @return string |
||
216 | */ |
||
217 | protected function formatLabelByMinutes(Chronos $date, bool $twelveHourTime): string |
||
225 | } |
||
226 |