@@ -163,8 +163,8 @@ discard block |
||
163 | 163 | if ($userAgent) { |
164 | 164 | $parser = new Parser($userAgent); |
165 | 165 | $sample->device = ($parser->device->model ?? ''); |
166 | - $sample->browser = ($parser->browser->name ?? '') . ' ' . $parser->browser->getVersion(); |
|
167 | - $sample->os = ($parser->os->name ?? '') . ' ' . $parser->os->getVersion(); |
|
166 | + $sample->browser = ($parser->browser->name ?? '').' '.$parser->browser->getVersion(); |
|
167 | + $sample->os = ($parser->os->name ?? '').' '.$parser->os->getVersion(); |
|
168 | 168 | $sample->mobile = $parser->isMobile(); |
169 | 169 | } |
170 | 170 | // Save the data sample |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $now = round(microtime(true) * 1000); |
202 | 202 | $cache = Craft::$app->getCache(); |
203 | 203 | $then = $cache->get(self::LAST_BEACON_CACHE_KEY); |
204 | - if (($then !== false) && ($now - (int)$then < Webperf::$settings->rateLimitMs)) { |
|
204 | + if (($then !== false) && ($now - (int) $then < Webperf::$settings->rateLimitMs)) { |
|
205 | 205 | $limited = true; |
206 | 206 | } |
207 | 207 | $cache->set(self::LAST_BEACON_CACHE_KEY, $now, 0); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | ->from(['{{%webperf_error_samples}}']) |
85 | 85 | ->where(['not', [$column => null]]) |
86 | 86 | ; |
87 | - if ((int)$siteId !== 0) { |
|
87 | + if ((int) $siteId !== 0) { |
|
88 | 88 | $query->andWhere(['siteId' => $siteId]); |
89 | 89 | } |
90 | 90 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | ->andWhere(['url' => $pageUrl]) |
123 | 123 | ; |
124 | 124 | } |
125 | - if ((int)$siteId !== 0) { |
|
125 | + if ((int) $siteId !== 0) { |
|
126 | 126 | $query->andWhere(['siteId' => $siteId]); |
127 | 127 | } |
128 | 128 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | ['not', ['title' => '']], |
149 | 149 | ]) |
150 | 150 | ; |
151 | - if ((int)$siteId !== 0) { |
|
151 | + if ((int) $siteId !== 0) { |
|
152 | 152 | $query->andWhere(['siteId' => $siteId]); |
153 | 153 | } |
154 | 154 | $result = $query->one(); |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | $now = round(microtime(true) * 1000); |
382 | 382 | $cache = Craft::$app->getCache(); |
383 | 383 | $then = $cache->get(self::LAST_ERRORSAMPLES_TRIM_CACHE_KEY); |
384 | - if (($then !== false) && ($now - (int)$then < Webperf::$settings->samplesRateLimitMs)) { |
|
384 | + if (($then !== false) && ($now - (int) $then < Webperf::$settings->samplesRateLimitMs)) { |
|
385 | 385 | $limited = true; |
386 | 386 | } |
387 | 387 | $cache->set(self::LAST_ERRORSAMPLES_TRIM_CACHE_KEY, $now, 0); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | ->from(['{{%webperf_data_samples}}']) |
87 | 87 | ->where(['not', [$column => null]]) |
88 | 88 | ; |
89 | - if ((int)$siteId !== 0) { |
|
89 | + if ((int) $siteId !== 0) { |
|
90 | 90 | $query->andWhere(['siteId' => $siteId]); |
91 | 91 | } |
92 | 92 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | ['not', ['title' => '']], |
113 | 113 | ]) |
114 | 114 | ; |
115 | - if ((int)$siteId !== 0) { |
|
115 | + if ((int) $siteId !== 0) { |
|
116 | 116 | $query->andWhere(['siteId' => $siteId]); |
117 | 117 | } |
118 | 118 | $result = $query->one(); |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | $now = round(microtime(true) * 1000); |
426 | 426 | $cache = Craft::$app->getCache(); |
427 | 427 | $then = $cache->get(self::LAST_DATASAMPLES_TRIM_CACHE_KEY); |
428 | - if (($then !== false) && ($now - (int)$then < Webperf::$settings->samplesRateLimitMs)) { |
|
428 | + if (($then !== false) && ($now - (int) $then < Webperf::$settings->samplesRateLimitMs)) { |
|
429 | 429 | $limited = true; |
430 | 430 | } |
431 | 431 | $cache->set(self::LAST_DATASAMPLES_TRIM_CACHE_KEY, $now, 0); |