Passed
Push — develop ( 5f0d39...a97721 )
by Andrew
03:27
created
src/services/DataSamples.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             ->from(['{{%webperf_data_samples}}'])
49 49
             ->where(['not', [$column => null]])
50 50
             ;
51
-        if ((int)$siteId !== 0) {
51
+        if ((int) $siteId !== 0) {
52 52
             $query->andWhere(['siteId' => $siteId]);
53 53
         }
54 54
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
                 ['not', ['title' => '']],
75 75
             ])
76 76
         ;
77
-        if ((int)$siteId !== 0) {
77
+        if ((int) $siteId !== 0) {
78 78
             $query->andWhere(['siteId' => $siteId]);
79 79
         }
80 80
         $result = $query->one();
Please login to merge, or discard this patch.
src/base/Recommendation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,6 +45,6 @@
 block discarded – undo
45 45
      */
46 46
     public function displayMs(int $number): string
47 47
     {
48
-        return number_format((float)$number / 1000, 2).'s';
48
+        return number_format((float) $number / 1000, 2).'s';
49 49
     }
50 50
 }
Please login to merge, or discard this patch.
src/Webperf.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
         $navItem = parent::getCpNavItem();
151 151
         $cache = Craft::$app->getCache();
152 152
         // See if there are any recommendations to add as a badge
153
-        $recommendations = $cache->getOrSet(self::RECOMMENDATIONS_CACHE_KEY, function () {
153
+        $recommendations = $cache->getOrSet(self::RECOMMENDATIONS_CACHE_KEY, function() {
154 154
             $data = [];
155 155
             $now = new \DateTime();
156 156
             $end = $now->format('Y-m-d');
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         Event::on(
265 265
             Plugins::class,
266 266
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
267
-            function (PluginEvent $event) {
267
+            function(PluginEvent $event) {
268 268
                 if ($event->plugin === $this) {
269 269
                     // Invalidate our caches after we've been installed
270 270
                     $this->clearAllCaches();
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
         Event::on(
293 293
             CraftVariable::class,
294 294
             CraftVariable::EVENT_INIT,
295
-            function (Event $event) {
295
+            function(Event $event) {
296 296
                 /** @var CraftVariable $variable */
297 297
                 $variable = $event->sender;
298 298
                 $variable->set('webperf', WebperfVariable::class);
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
         Event::on(
303 303
             Plugins::class,
304 304
             Plugins::EVENT_AFTER_LOAD_PLUGINS,
305
-            function () {
305
+            function() {
306 306
                 // Install these only after all other plugins have loaded
307 307
                 $request = Craft::$app->getRequest();
308 308
                 // Only respond to non-console site requests
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
         Event::on(
327 327
             UrlManager::class,
328 328
             UrlManager::EVENT_REGISTER_SITE_URL_RULES,
329
-            function (RegisterUrlRulesEvent $event) {
329
+            function(RegisterUrlRulesEvent $event) {
330 330
                 Craft::debug(
331 331
                     'UrlManager::EVENT_REGISTER_SITE_URL_RULES',
332 332
                     __METHOD__
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
         Event::on(
350 350
             UrlManager::class,
351 351
             UrlManager::EVENT_REGISTER_CP_URL_RULES,
352
-            function (RegisterUrlRulesEvent $event) {
352
+            function(RegisterUrlRulesEvent $event) {
353 353
                 Craft::debug(
354 354
                     'UrlManager::EVENT_REGISTER_CP_URL_RULES',
355 355
                     __METHOD__
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
         Event::on(
366 366
             Dashboard::class,
367 367
             Dashboard::EVENT_REGISTER_WIDGET_TYPES,
368
-            function (RegisterComponentTypesEvent $event) {
368
+            function(RegisterComponentTypesEvent $event) {
369 369
                 $event->types[] = MetricsWidget::class;
370 370
             }
371 371
         );
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
         Event::on(
374 374
             UserPermissions::class,
375 375
             UserPermissions::EVENT_REGISTER_PERMISSIONS,
376
-            function (RegisterUserPermissionsEvent $event) {
376
+            function(RegisterUserPermissionsEvent $event) {
377 377
                 Craft::debug(
378 378
                     'UserPermissions::EVENT_REGISTER_PERMISSIONS',
379 379
                     __METHOD__
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
             Event::on(
399 399
                 View::class,
400 400
                 View::EVENT_END_PAGE,
401
-                function () {
401
+                function() {
402 402
                     Craft::debug(
403 403
                         'View::EVENT_END_PAGE',
404 404
                         __METHOD__
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
             Event::on(
423 423
                 View::class,
424 424
                 View::EVENT_END_BODY,
425
-                function () {
425
+                function() {
426 426
                     Craft::debug(
427 427
                         'View::EVENT_END_BODY',
428 428
                         __METHOD__
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
             Event::on(
446 446
                 Application::class,
447 447
                 Application::EVENT_AFTER_REQUEST,
448
-                function () {
448
+                function() {
449 449
                     Craft::debug(
450 450
                         'Application::EVENT_AFTER_REQUEST',
451 451
                         __METHOD__
Please login to merge, or discard this patch.
src/services/ErrorSamples.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
             ->from(['{{%webperf_error_samples}}'])
46 46
             ->where(['not', [$column => null]])
47 47
             ;
48
-        if ((int)$siteId !== 0) {
48
+        if ((int) $siteId !== 0) {
49 49
             $query->andWhere(['siteId' => $siteId]);
50 50
         }
51 51
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                 ['not', ['title' => '']],
72 72
             ])
73 73
         ;
74
-        if ((int)$siteId !== 0) {
74
+        if ((int) $siteId !== 0) {
75 75
             $query->andWhere(['siteId' => $siteId]);
76 76
         }
77 77
         $result = $query->one();
Please login to merge, or discard this patch.
src/controllers/ChartsController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             ])
82 82
             ->where(['between', 'dateCreated', $start, $end])
83 83
             ->andWhere(['not', [$column => null]]);
84
-        if ((int)$siteId !== 0) {
84
+        if ((int) $siteId !== 0) {
85 85
             $query->andWhere(['siteId' => $siteId]);
86 86
         }
87 87
         if ($pageUrl !== '') {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         // Massage the data
92 92
         if ($stats) {
93 93
             foreach ($stats as &$stat) {
94
-                $stat['cnt'] = (int)$stat['cnt'];
94
+                $stat['cnt'] = (int) $stat['cnt'];
95 95
             }
96 96
             $data = $stats[0];
97 97
         }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
             ])
137 137
             ->where(['between', 'dateCreated', $start, $end])
138 138
             ->andWhere(['not', [$column => null]]);
139
-        if ((int)$siteId !== 0) {
139
+        if ((int) $siteId !== 0) {
140 140
             $query->andWhere(['siteId' => $siteId]);
141 141
         }
142 142
         $query
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         // Massage the data
148 148
         if ($stats) {
149 149
             foreach ($stats as &$stat) {
150
-                $stat['cnt'] = (int)$stat['cnt'];
150
+                $stat['cnt'] = (int) $stat['cnt'];
151 151
                 $stat['detailPageUrl'] = UrlHelper::cpUrl('webperf/performance/page-detail', [
152 152
                     'pageUrl' => $stat['url'],
153 153
                     'siteId' => $siteId,
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
             ])
219 219
             ->where(['between', 'dateCreated', $start, $end])
220 220
             ;
221
-        if ((int)$siteId !== 0) {
221
+        if ((int) $siteId !== 0) {
222 222
             $query->andWhere(['siteId' => $siteId]);
223 223
         }
224 224
         if ($pageUrl !== '') {
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
             ])
348 348
             ->where(['between', 'dateCreated', $start, $end])
349 349
         ;
350
-        if ((int)$siteId !== 0) {
350
+        if ((int) $siteId !== 0) {
351 351
             $query->andWhere(['siteId' => $siteId]);
352 352
         }
353 353
         if ($pageUrl !== '') {
@@ -386,11 +386,11 @@  discard block
 block discarded – undo
386 386
             foreach ($stats as $stat) {
387 387
                 switch ($stat['type']) {
388 388
                     case 'boomerang':
389
-                        $boomerangErrors['data'][] = (int)$stat['cnt'];
389
+                        $boomerangErrors['data'][] = (int) $stat['cnt'];
390 390
                         $boomerangErrors['labels'][] = $stat['sampleDate'];
391 391
                         break;
392 392
                     case 'craft':
393
-                        $craftErrors['data'][] = (int)$stat['cnt'];
393
+                        $craftErrors['data'][] = (int) $stat['cnt'];
394 394
                         $craftErrors['labels'][] = $stat['sampleDate'];
395 395
                         break;
396 396
                 }
Please login to merge, or discard this patch.
src/controllers/TablesController.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             ->offset($offset)
105 105
             ->where(['between', 'dateCreated', $start, $end])
106 106
         ;
107
-        if ((int)$siteId !== 0) {
107
+        if ((int) $siteId !== 0) {
108 108
             $query->andWhere(['siteId' => $siteId]);
109 109
         }
110 110
         if ($filter !== '') {
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
             $index = 1;
144 144
             foreach ($stats as &$stat) {
145 145
                 $stat['id'] = $index++;
146
-                $stat['cnt'] = (int)$stat['cnt'];
147
-                $stat['maxTotalPageLoad'] = (int)$maxTotalPageLoad;
146
+                $stat['cnt'] = (int) $stat['cnt'];
147
+                $stat['maxTotalPageLoad'] = (int) $maxTotalPageLoad;
148 148
                 // Decode any emojis in the title
149 149
                 if (!empty($stat['title'])) {
150 150
                     $stat['title'] = html_entity_decode($stat['title'], ENT_NOQUOTES, 'UTF-8');
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
             ->where(['url' => $pageUrl])
243 243
             ->andWhere(['between', 'dateCreated', $start, $end])
244 244
         ;
245
-        if ((int)$siteId !== 0) {
245
+        if ((int) $siteId !== 0) {
246 246
             $query->andWhere(['siteId' => $siteId]);
247 247
         }
248 248
         if ($filter !== '') {
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
                     $stat['type'] = 'frontend';
275 275
                 }
276 276
                 if ($stat['pageLoad'] > $maxTotalPageLoad) {
277
-                    $maxTotalPageLoad = (int)$stat['pageLoad'];
277
+                    $maxTotalPageLoad = (int) $stat['pageLoad'];
278 278
                 }
279 279
             }
280 280
             // Massage the stats
@@ -283,8 +283,8 @@  discard block
 block discarded – undo
283 283
                     $date = DateTimeHelper::toDateTime($stats['dateCreated']);
284 284
                     $stats['dateCreated'] = $date->format('Y-m-d H:i:s');
285 285
                 }
286
-                $stat['mobile'] = (bool)$stat['mobile'];
287
-                $stat['maxTotalPageLoad'] = (int)$maxTotalPageLoad;
286
+                $stat['mobile'] = (bool) $stat['mobile'];
287
+                $stat['maxTotalPageLoad'] = (int) $maxTotalPageLoad;
288 288
                 // Decode any emojis in the title
289 289
                 if (!empty($stat['title'])) {
290 290
                     $stat['title'] = html_entity_decode($stat['title'], ENT_NOQUOTES, 'UTF-8');
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
             ->offset($offset)
382 382
             ->where(['between', 'dateCreated', $start, $end])
383 383
         ;
384
-        if ((int)$siteId !== 0) {
384
+        if ((int) $siteId !== 0) {
385 385
             $query->andWhere(['siteId' => $siteId]);
386 386
         }
387 387
         if ($filter !== '') {
@@ -402,9 +402,9 @@  discard block
 block discarded – undo
402 402
             $user = Craft::$app->getUser()->getIdentity();
403 403
             // Massage the stats
404 404
             foreach ($stats as &$stat) {
405
-                $stat['cnt'] = (int)$stat['cnt'];
406
-                $stat['craftCount'] = (int)$stat['craftCount'];
407
-                $stat['boomerangCount'] = (int)$stat['boomerangCount'];
405
+                $stat['cnt'] = (int) $stat['cnt'];
406
+                $stat['craftCount'] = (int) $stat['craftCount'];
407
+                $stat['boomerangCount'] = (int) $stat['boomerangCount'];
408 408
                 // Decode any emojis in the title
409 409
                 if (!empty($stat['title'])) {
410 410
                     $stat['title'] = html_entity_decode($stat['title'], ENT_NOQUOTES, 'UTF-8');
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
             ->where(['url' => $pageUrl])
507 507
             ->andWhere(['between', 'dateCreated', $start, $end])
508 508
         ;
509
-        if ((int)$siteId !== 0) {
509
+        if ((int) $siteId !== 0) {
510 510
             $query->andWhere(['siteId' => $siteId]);
511 511
         }
512 512
         if ($filter !== '') {
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
                     $stats['dateCreated'] = $date->format('Y-m-d H:i:s');
535 535
                 }
536 536
                 if (isset($stat['mobile'])) {
537
-                    $stat['mobile'] = (bool)$stat['mobile'];
537
+                    $stat['mobile'] = (bool) $stat['mobile'];
538 538
                 }
539 539
                 // Decode any emojis in the title
540 540
                 if (!empty($stat['title'])) {
Please login to merge, or discard this patch.