Passed
Push — v1 ( c01b49...c84f88 )
by Andrew
18:56 queued 11:29
created
src/Webperf.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         Event::on(
316 316
             Plugins::class,
317 317
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
318
-            function (PluginEvent $event) {
318
+            function(PluginEvent $event) {
319 319
                 if ($event->plugin === $this) {
320 320
                     // Invalidate our caches after we've been installed
321 321
                     $this->clearAllCaches();
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
         Event::on(
344 344
             CraftVariable::class,
345 345
             CraftVariable::EVENT_INIT,
346
-            function (Event $event) {
346
+            function(Event $event) {
347 347
                 /** @var CraftVariable $variable */
348 348
                 $variable = $event->sender;
349 349
                 $variable->set('webperf', WebperfVariable::class);
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
         Event::on(
354 354
             Plugins::class,
355 355
             Plugins::EVENT_AFTER_LOAD_PLUGINS,
356
-            function () {
356
+            function() {
357 357
                 // Install these only after all other plugins have loaded
358 358
                 $request = Craft::$app->getRequest();
359 359
                 // Only respond to non-console site requests
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
         Event::on(
378 378
             UrlManager::class,
379 379
             UrlManager::EVENT_REGISTER_SITE_URL_RULES,
380
-            function (RegisterUrlRulesEvent $event) {
380
+            function(RegisterUrlRulesEvent $event) {
381 381
                 Craft::debug(
382 382
                     'UrlManager::EVENT_REGISTER_SITE_URL_RULES',
383 383
                     __METHOD__
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
         Event::on(
401 401
             UrlManager::class,
402 402
             UrlManager::EVENT_REGISTER_CP_URL_RULES,
403
-            function (RegisterUrlRulesEvent $event) {
403
+            function(RegisterUrlRulesEvent $event) {
404 404
                 Craft::debug(
405 405
                     'UrlManager::EVENT_REGISTER_CP_URL_RULES',
406 406
                     __METHOD__
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
         Event::on(
417 417
             UserPermissions::class,
418 418
             UserPermissions::EVENT_REGISTER_PERMISSIONS,
419
-            function (RegisterUserPermissionsEvent $event) {
419
+            function(RegisterUserPermissionsEvent $event) {
420 420
                 Craft::debug(
421 421
                     'UserPermissions::EVENT_REGISTER_PERMISSIONS',
422 422
                     __METHOD__
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
             Event::on(
447 447
                 View::class,
448 448
                 View::EVENT_END_PAGE,
449
-                function () {
449
+                function() {
450 450
                     Craft::debug(
451 451
                         'View::EVENT_END_PAGE',
452 452
                         __METHOD__
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
             Event::on(
475 475
                 View::class,
476 476
                 View::EVENT_END_BODY,
477
-                function () {
477
+                function() {
478 478
                     Craft::debug(
479 479
                         'View::EVENT_END_BODY',
480 480
                         __METHOD__
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
             Event::on(
498 498
                 Application::class,
499 499
                 Application::EVENT_AFTER_REQUEST,
500
-                function () {
500
+                function() {
501 501
                     Craft::debug(
502 502
                         'Application::EVENT_AFTER_REQUEST',
503 503
                         __METHOD__
@@ -523,21 +523,21 @@  discard block
 block discarded – undo
523 523
         if (self::$settings->displaySidebar && $currentUser && $currentUser->can('webperf:sidebar')) {
524 524
             $view = Craft::$app->getView();
525 525
             // Entries sidebar
526
-            $view->hook('cp.entries.edit.details', function (&$context) {
526
+            $view->hook('cp.entries.edit.details', function(&$context) {
527 527
                 /** @var  Element $element */
528 528
                 $element = $context['entry'] ?? null;
529 529
 
530 530
                 return $this->renderSidebar($element);
531 531
             });
532 532
             // Category Groups sidebar
533
-            $view->hook('cp.categories.edit.details', function (&$context) {
533
+            $view->hook('cp.categories.edit.details', function(&$context) {
534 534
                 /** @var  Element $element */
535 535
                 $element = $context['category'] ?? null;
536 536
 
537 537
                 return $this->renderSidebar($element);
538 538
             });
539 539
             // Commerce Product Types sidebar
540
-            $view->hook('cp.commerce.product.edit.details', function (&$context) {
540
+            $view->hook('cp.commerce.product.edit.details', function(&$context) {
541 541
                 /** @var  Element $element */
542 542
                 $element = $context['product'] ?? null;
543 543
 
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
     {
756 756
         $cache = Craft::$app->getCache();
757 757
         // See if there are any recommendations to add as a badge
758
-        $recommendations = $cache->getOrSet(self::RECOMMENDATIONS_CACHE_KEY, function () {
758
+        $recommendations = $cache->getOrSet(self::RECOMMENDATIONS_CACHE_KEY, function() {
759 759
             $data = [];
760 760
             $now = new \DateTime();
761 761
             $end = $now->format('Y-m-d');
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
             $recommendations = '';
774 774
         }
775 775
 
776
-        return (string)$recommendations;
776
+        return (string) $recommendations;
777 777
     }
778 778
 
779 779
     /**
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
     {
786 786
         $cache = Craft::$app->getCache();
787 787
         // See if there are any recommendations to add as a badge
788
-        $errors = $cache->getOrSet(self::ERRORS_CACHE_KEY, function () {
788
+        $errors = $cache->getOrSet(self::ERRORS_CACHE_KEY, function() {
789 789
             $now = new \DateTime();
790 790
             $end = $now->format('Y-m-d');
791 791
             $start = $now->modify('-30 days')->format('Y-m-d');
@@ -799,6 +799,6 @@  discard block
 block discarded – undo
799 799
             $errors = '⚠';
800 800
         }
801 801
 
802
-        return (string)$errors;
802
+        return (string) $errors;
803 803
     }
804 804
 }
Please login to merge, or discard this patch.