@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | ]) |
71 | 71 | ->where("dateUpdated >= ( CURDATE() - INTERVAL '{$days}' DAY )") |
72 | 72 | ->andWhere(['not', [$column => null]]); |
73 | - if ((int)$siteId !== 0) { |
|
73 | + if ((int) $siteId !== 0) { |
|
74 | 74 | $query->andWhere(['siteId' => $siteId]); |
75 | 75 | } |
76 | 76 | $stats = $query->all(); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | ]) |
85 | 85 | ->where("\"dateUpdated\" >= ( CURRENT_TIMESTAMP - INTERVAL '{$days} days' )") |
86 | 86 | ->andWhere(['not', [$column => null]]); |
87 | - if ((int)$siteId !== 0) { |
|
87 | + if ((int) $siteId !== 0) { |
|
88 | 88 | $query->andWhere(['siteId' => $siteId]); |
89 | 89 | } |
90 | 90 | $stats = $query->all(); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | ]) |
131 | 131 | ->where("dateUpdated >= ( CURDATE() - INTERVAL '{$days}' DAY )") |
132 | 132 | ->andWhere(['not', [$column => null]]); |
133 | - if ((int)$siteId !== 0) { |
|
133 | + if ((int) $siteId !== 0) { |
|
134 | 134 | $query->andWhere(['siteId' => $siteId]); |
135 | 135 | } |
136 | 136 | $query |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | ]) |
152 | 152 | ->where("\"dateUpdated\" >= ( CURRENT_TIMESTAMP - INTERVAL '{$days} days' )") |
153 | 153 | ->andWhere(['not', [$column => null]]); |
154 | - if ((int)$siteId !== 0) { |
|
154 | + if ((int) $siteId !== 0) { |
|
155 | 155 | $query->andWhere(['siteId' => $siteId]); |
156 | 156 | } |
157 | 157 | $query |
@@ -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'])) { |