@@ -185,7 +185,7 @@ |
||
185 | 185 | $now = round(microtime(true) * 1000); |
186 | 186 | $cache = Craft::$app->getCache(); |
187 | 187 | $then = $cache->get(self::LAST_BEACON_CACHE_KEY); |
188 | - if (($then !== false) && ($now - (int)$then < Webperf::$settings->rateLimitMs)) { |
|
188 | + if (($then !== false) && ($now - (int) $then < Webperf::$settings->rateLimitMs)) { |
|
189 | 189 | $limited = true; |
190 | 190 | Craft::warning('Beacon ignored due to rate limiting', __METHOD__); |
191 | 191 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | ->from(['{{%webperf_data_samples}}']) |
100 | 100 | ->offset($offset) |
101 | 101 | ; |
102 | - if ((int)$siteId !== 0) { |
|
102 | + if ((int) $siteId !== 0) { |
|
103 | 103 | $query->where(['siteId' => $siteId]); |
104 | 104 | } |
105 | 105 | if ($filter !== '') { |
@@ -142,12 +142,12 @@ discard block |
||
142 | 142 | $index = 1; |
143 | 143 | foreach ($stats as &$stat) { |
144 | 144 | $stat['id'] = $index++; |
145 | - $stat['maxTotalPageLoad'] = (int)$maxTotalPageLoad; |
|
145 | + $stat['maxTotalPageLoad'] = (int) $maxTotalPageLoad; |
|
146 | 146 | // If there is no frontend beacon timing, use the Craft timing |
147 | 147 | if (empty($stat['pageLoad'])) { |
148 | - $stat['totalPageLoad'] = (int)$stat['craftTotalMs']; |
|
148 | + $stat['totalPageLoad'] = (int) $stat['craftTotalMs']; |
|
149 | 149 | } else { |
150 | - $stat['totalPageLoad'] = (int)$stat['pageLoad']; |
|
150 | + $stat['totalPageLoad'] = (int) $stat['pageLoad']; |
|
151 | 151 | } |
152 | 152 | // Decode any emojis in the title |
153 | 153 | if (!empty($stat['title'])) { |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | ->offset($offset) |
240 | 240 | ->where(['url' => $pageUrl]) |
241 | 241 | ; |
242 | - if ((int)$siteId !== 0) { |
|
242 | + if ((int) $siteId !== 0) { |
|
243 | 243 | $query->where(['siteId' => $siteId]); |
244 | 244 | } |
245 | 245 | if ($filter !== '') { |
@@ -281,12 +281,12 @@ discard block |
||
281 | 281 | } |
282 | 282 | // Massage the stats |
283 | 283 | foreach ($stats as &$stat) { |
284 | - $stat['maxTotalPageLoad'] = (int)$maxTotalPageLoad; |
|
284 | + $stat['maxTotalPageLoad'] = (int) $maxTotalPageLoad; |
|
285 | 285 | // If there is no frontend beacon timing, use the Craft timing |
286 | 286 | if (empty($stat['pageLoad'])) { |
287 | - $stat['totalPageLoad'] = (int)$stat['craftTotalMs']; |
|
287 | + $stat['totalPageLoad'] = (int) $stat['craftTotalMs']; |
|
288 | 288 | } else { |
289 | - $stat['totalPageLoad'] = (int)$stat['pageLoad']; |
|
289 | + $stat['totalPageLoad'] = (int) $stat['pageLoad']; |
|
290 | 290 | } |
291 | 291 | // Decode any emojis in the title |
292 | 292 | if (!empty($stat['title'])) { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | ->from(['{{%webperf_data_samples}}']) |
43 | 43 | ->where(['not', [$column => null]]) |
44 | 44 | ; |
45 | - if ((int)$siteId !== 0) { |
|
45 | + if ((int) $siteId !== 0) { |
|
46 | 46 | $query->andWhere(['siteId' => $siteId]); |
47 | 47 | } |
48 | 48 | return $query->count(); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | ['not', ['title' => '']], |
68 | 68 | ]) |
69 | 69 | ; |
70 | - if ((int)$siteId !== 0) { |
|
70 | + if ((int) $siteId !== 0) { |
|
71 | 71 | $query->andWhere(['siteId' => $siteId]); |
72 | 72 | } |
73 | 73 | $result = $query->one(); |