Passed
Push — develop ( 740953...5aeb44 )
by Andrew
03:29
created
src/Webperf.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
         Event::on(
293 293
             Plugins::class,
294 294
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
295
-            function (PluginEvent $event) {
295
+            function(PluginEvent $event) {
296 296
                 if ($event->plugin === $this) {
297 297
                     // Invalidate our caches after we've been installed
298 298
                     $this->clearAllCaches();
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
         Event::on(
321 321
             CraftVariable::class,
322 322
             CraftVariable::EVENT_INIT,
323
-            function (Event $event) {
323
+            function(Event $event) {
324 324
                 /** @var CraftVariable $variable */
325 325
                 $variable = $event->sender;
326 326
                 $variable->set('webperf', WebperfVariable::class);
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
         Event::on(
331 331
             Plugins::class,
332 332
             Plugins::EVENT_AFTER_LOAD_PLUGINS,
333
-            function () {
333
+            function() {
334 334
                 // Install these only after all other plugins have loaded
335 335
                 $request = Craft::$app->getRequest();
336 336
                 // Only respond to non-console site requests
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
         Event::on(
355 355
             UrlManager::class,
356 356
             UrlManager::EVENT_REGISTER_SITE_URL_RULES,
357
-            function (RegisterUrlRulesEvent $event) {
357
+            function(RegisterUrlRulesEvent $event) {
358 358
                 Craft::debug(
359 359
                     'UrlManager::EVENT_REGISTER_SITE_URL_RULES',
360 360
                     __METHOD__
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
         Event::on(
378 378
             UrlManager::class,
379 379
             UrlManager::EVENT_REGISTER_CP_URL_RULES,
380
-            function (RegisterUrlRulesEvent $event) {
380
+            function(RegisterUrlRulesEvent $event) {
381 381
                 Craft::debug(
382 382
                     'UrlManager::EVENT_REGISTER_CP_URL_RULES',
383 383
                     __METHOD__
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
         Event::on(
394 394
             Dashboard::class,
395 395
             Dashboard::EVENT_REGISTER_WIDGET_TYPES,
396
-            function (RegisterComponentTypesEvent $event) {
396
+            function(RegisterComponentTypesEvent $event) {
397 397
                 $event->types[] = MetricsWidget::class;
398 398
             }
399 399
         );
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
         Event::on(
402 402
             UserPermissions::class,
403 403
             UserPermissions::EVENT_REGISTER_PERMISSIONS,
404
-            function (RegisterUserPermissionsEvent $event) {
404
+            function(RegisterUserPermissionsEvent $event) {
405 405
                 Craft::debug(
406 406
                     'UserPermissions::EVENT_REGISTER_PERMISSIONS',
407 407
                     __METHOD__
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
             Event::on(
427 427
                 View::class,
428 428
                 View::EVENT_END_PAGE,
429
-                function () {
429
+                function() {
430 430
                     Craft::debug(
431 431
                         'View::EVENT_END_PAGE',
432 432
                         __METHOD__
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
             Event::on(
451 451
                 View::class,
452 452
                 View::EVENT_END_BODY,
453
-                function () {
453
+                function() {
454 454
                     Craft::debug(
455 455
                         'View::EVENT_END_BODY',
456 456
                         __METHOD__
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
             Event::on(
474 474
                 Application::class,
475 475
                 Application::EVENT_AFTER_REQUEST,
476
-                function () {
476
+                function() {
477 477
                     Craft::debug(
478 478
                         'Application::EVENT_AFTER_REQUEST',
479 479
                         __METHOD__
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
     {
646 646
         $cache = Craft::$app->getCache();
647 647
         // See if there are any recommendations to add as a badge
648
-        $recommendations = $cache->getOrSet(self::RECOMMENDATIONS_CACHE_KEY, function () {
648
+        $recommendations = $cache->getOrSet(self::RECOMMENDATIONS_CACHE_KEY, function() {
649 649
             $data = [];
650 650
             $now = new \DateTime();
651 651
             $end = $now->format('Y-m-d');
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
             $recommendations = '';
664 664
         }
665 665
 
666
-        return (string)$recommendations;
666
+        return (string) $recommendations;
667 667
     }
668 668
 
669 669
     /**
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
     {
676 676
         $cache = Craft::$app->getCache();
677 677
         // See if there are any recommendations to add as a badge
678
-        $errors = $cache->getOrSet(self::ERRORS_CACHE_KEY, function () {
678
+        $errors = $cache->getOrSet(self::ERRORS_CACHE_KEY, function() {
679 679
             $now = new \DateTime();
680 680
             $end = $now->format('Y-m-d');
681 681
             $start = $now->modify('-30 days')->format('Y-m-d');
@@ -689,6 +689,6 @@  discard block
 block discarded – undo
689 689
             $errors = '⚠';
690 690
         }
691 691
 
692
-        return (string)$errors;
692
+        return (string) $errors;
693 693
     }
694 694
 }
Please login to merge, or discard this patch.
src/services/ErrorSamples.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
             ->from(['{{%webperf_error_samples}}'])
83 83
             ->where(['not', [$column => null]])
84 84
             ;
85
-        if ((int)$siteId !== 0) {
85
+        if ((int) $siteId !== 0) {
86 86
             $query->andWhere(['siteId' => $siteId]);
87 87
         }
88 88
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             ->from(['{{%webperf_error_samples}}'])
109 109
             ->where(['between', 'dateCreated', $start, $end])
110 110
         ;
111
-        if ((int)$siteId !== 0) {
111
+        if ((int) $siteId !== 0) {
112 112
             $query->andWhere(['siteId' => $siteId]);
113 113
         }
114 114
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
                 ['not', ['title' => '']],
135 135
             ])
136 136
         ;
137
-        if ((int)$siteId !== 0) {
137
+        if ((int) $siteId !== 0) {
138 138
             $query->andWhere(['siteId' => $siteId]);
139 139
         }
140 140
         $result = $query->one();
Please login to merge, or discard this patch.