Passed
Push — develop ( 3a5386...1ae14b )
by Andrew
03:56
created
src/Webperf.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
         Event::on(
324 324
             Plugins::class,
325 325
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
326
-            function (PluginEvent $event) {
326
+            function(PluginEvent $event) {
327 327
                 if ($event->plugin === $this) {
328 328
                     // Invalidate our caches after we've been installed
329 329
                     $this->clearAllCaches();
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
         Event::on(
352 352
             CraftVariable::class,
353 353
             CraftVariable::EVENT_INIT,
354
-            function (Event $event) {
354
+            function(Event $event) {
355 355
                 /** @var CraftVariable $variable */
356 356
                 $variable = $event->sender;
357 357
                 $variable->set('webperf', WebperfVariable::class);
@@ -361,11 +361,11 @@  discard block
 block discarded – undo
361 361
         Event::on(
362 362
             Plugins::class,
363 363
             Plugins::EVENT_AFTER_LOAD_PLUGINS,
364
-            function () {
364
+            function() {
365 365
                 // Install these only after all other plugins have loaded
366 366
                 $request = Craft::$app->getRequest();
367 367
                 // Only respond to non-console site requests
368
-                if ($request->getIsSiteRequest() && !$request->getIsConsoleRequest()  && !$request->getIsLivePreview()) {
368
+                if ($request->getIsSiteRequest() && !$request->getIsConsoleRequest() && !$request->getIsLivePreview()) {
369 369
                     $this->handleSiteRequest();
370 370
                 }
371 371
                 // Respond to Control Panel requests
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
         Event::on(
386 386
             UrlManager::class,
387 387
             UrlManager::EVENT_REGISTER_SITE_URL_RULES,
388
-            function (RegisterUrlRulesEvent $event) {
388
+            function(RegisterUrlRulesEvent $event) {
389 389
                 Craft::debug(
390 390
                     'UrlManager::EVENT_REGISTER_SITE_URL_RULES',
391 391
                     __METHOD__
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
         Event::on(
409 409
             UrlManager::class,
410 410
             UrlManager::EVENT_REGISTER_CP_URL_RULES,
411
-            function (RegisterUrlRulesEvent $event) {
411
+            function(RegisterUrlRulesEvent $event) {
412 412
                 Craft::debug(
413 413
                     'UrlManager::EVENT_REGISTER_CP_URL_RULES',
414 414
                     __METHOD__
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
         Event::on(
425 425
             UserPermissions::class,
426 426
             UserPermissions::EVENT_REGISTER_PERMISSIONS,
427
-            function (RegisterUserPermissionsEvent $event) {
427
+            function(RegisterUserPermissionsEvent $event) {
428 428
                 Craft::debug(
429 429
                     'UserPermissions::EVENT_REGISTER_PERMISSIONS',
430 430
                     __METHOD__
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
             Event::on(
455 455
                 View::class,
456 456
                 View::EVENT_END_PAGE,
457
-                function () {
457
+                function() {
458 458
                     Craft::debug(
459 459
                         'View::EVENT_END_PAGE',
460 460
                         __METHOD__
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
             Event::on(
483 483
                 View::class,
484 484
                 View::EVENT_END_BODY,
485
-                function () {
485
+                function() {
486 486
                     Craft::debug(
487 487
                         'View::EVENT_END_BODY',
488 488
                         __METHOD__
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
             Event::on(
506 506
                 Application::class,
507 507
                 Application::EVENT_AFTER_REQUEST,
508
-                function () {
508
+                function() {
509 509
                     Craft::debug(
510 510
                         'Application::EVENT_AFTER_REQUEST',
511 511
                         __METHOD__
@@ -531,21 +531,21 @@  discard block
 block discarded – undo
531 531
         if (self::$settings->displaySidebar && $currentUser && $currentUser->can('webperf:sidebar')) {
532 532
             $view = Craft::$app->getView();
533 533
             // Entries sidebar
534
-            $view->hook('cp.entries.edit.details', function (&$context) {
534
+            $view->hook('cp.entries.edit.details', function(&$context) {
535 535
                 /** @var  Element $element */
536 536
                 $element = $context['entry'] ?? null;
537 537
 
538 538
                 return $this->renderSidebar($element);
539 539
             });
540 540
             // Category Groups sidebar
541
-            $view->hook('cp.categories.edit.details', function (&$context) {
541
+            $view->hook('cp.categories.edit.details', function(&$context) {
542 542
                 /** @var  Element $element */
543 543
                 $element = $context['category'] ?? null;
544 544
 
545 545
                 return $this->renderSidebar($element);
546 546
             });
547 547
             // Commerce Product Types sidebar
548
-            $view->hook('cp.commerce.product.edit.details', function (&$context) {
548
+            $view->hook('cp.commerce.product.edit.details', function(&$context) {
549 549
                 /** @var  Element $element */
550 550
                 $element = $context['product'] ?? null;
551 551
 
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
     {
766 766
         $cache = Craft::$app->getCache();
767 767
         // See if there are any recommendations to add as a badge
768
-        $recommendations = $cache->getOrSet(self::RECOMMENDATIONS_CACHE_KEY, function () {
768
+        $recommendations = $cache->getOrSet(self::RECOMMENDATIONS_CACHE_KEY, function() {
769 769
             $data = [];
770 770
             $now = new \DateTime();
771 771
             $end = $now->format('Y-m-d');
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
             $recommendations = '';
784 784
         }
785 785
 
786
-        return (string)$recommendations;
786
+        return (string) $recommendations;
787 787
     }
788 788
 
789 789
     /**
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
     {
796 796
         $cache = Craft::$app->getCache();
797 797
         // See if there are any recommendations to add as a badge
798
-        $errors = $cache->getOrSet(self::ERRORS_CACHE_KEY, function () {
798
+        $errors = $cache->getOrSet(self::ERRORS_CACHE_KEY, function() {
799 799
             $now = new \DateTime();
800 800
             $end = $now->format('Y-m-d');
801 801
             $start = $now->modify('-30 days')->format('Y-m-d');
@@ -809,6 +809,6 @@  discard block
 block discarded – undo
809 809
             $errors = '⚠';
810 810
         }
811 811
 
812
-        return (string)$errors;
812
+        return (string) $errors;
813 813
     }
814 814
 }
Please login to merge, or discard this patch.