Passed
Push — develop ( 44bb2f...63a776 )
by Andrew
03:35
created
src/Webperf.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
         Event::on(
302 302
             Plugins::class,
303 303
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
304
-            function (PluginEvent $event) {
304
+            function(PluginEvent $event) {
305 305
                 if ($event->plugin === $this) {
306 306
                     // Invalidate our caches after we've been installed
307 307
                     $this->clearAllCaches();
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
         Event::on(
330 330
             CraftVariable::class,
331 331
             CraftVariable::EVENT_INIT,
332
-            function (Event $event) {
332
+            function(Event $event) {
333 333
                 /** @var CraftVariable $variable */
334 334
                 $variable = $event->sender;
335 335
                 $variable->set('webperf', WebperfVariable::class);
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
         Event::on(
340 340
             Plugins::class,
341 341
             Plugins::EVENT_AFTER_LOAD_PLUGINS,
342
-            function () {
342
+            function() {
343 343
                 // Install these only after all other plugins have loaded
344 344
                 $request = Craft::$app->getRequest();
345 345
                 // Only respond to non-console site requests
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
         Event::on(
364 364
             UrlManager::class,
365 365
             UrlManager::EVENT_REGISTER_SITE_URL_RULES,
366
-            function (RegisterUrlRulesEvent $event) {
366
+            function(RegisterUrlRulesEvent $event) {
367 367
                 Craft::debug(
368 368
                     'UrlManager::EVENT_REGISTER_SITE_URL_RULES',
369 369
                     __METHOD__
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
         Event::on(
387 387
             UrlManager::class,
388 388
             UrlManager::EVENT_REGISTER_CP_URL_RULES,
389
-            function (RegisterUrlRulesEvent $event) {
389
+            function(RegisterUrlRulesEvent $event) {
390 390
                 Craft::debug(
391 391
                     'UrlManager::EVENT_REGISTER_CP_URL_RULES',
392 392
                     __METHOD__
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
         Event::on(
403 403
             Dashboard::class,
404 404
             Dashboard::EVENT_REGISTER_WIDGET_TYPES,
405
-            function (RegisterComponentTypesEvent $event) {
405
+            function(RegisterComponentTypesEvent $event) {
406 406
                 $event->types[] = MetricsWidget::class;
407 407
             }
408 408
         );
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
         Event::on(
411 411
             UserPermissions::class,
412 412
             UserPermissions::EVENT_REGISTER_PERMISSIONS,
413
-            function (RegisterUserPermissionsEvent $event) {
413
+            function(RegisterUserPermissionsEvent $event) {
414 414
                 Craft::debug(
415 415
                     'UserPermissions::EVENT_REGISTER_PERMISSIONS',
416 416
                     __METHOD__
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
             Event::on(
436 436
                 View::class,
437 437
                 View::EVENT_END_PAGE,
438
-                function () {
438
+                function() {
439 439
                     Craft::debug(
440 440
                         'View::EVENT_END_PAGE',
441 441
                         __METHOD__
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
             Event::on(
460 460
                 View::class,
461 461
                 View::EVENT_END_BODY,
462
-                function () {
462
+                function() {
463 463
                     Craft::debug(
464 464
                         'View::EVENT_END_BODY',
465 465
                         __METHOD__
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
             Event::on(
483 483
                 Application::class,
484 484
                 Application::EVENT_AFTER_REQUEST,
485
-                function () {
485
+                function() {
486 486
                     Craft::debug(
487 487
                         'Application::EVENT_AFTER_REQUEST',
488 488
                         __METHOD__
@@ -506,21 +506,21 @@  discard block
 block discarded – undo
506 506
         if (self::$settings->displaySidebar) {
507 507
             $view = Craft::$app->getView();
508 508
             // Entries sidebar
509
-            $view->hook('cp.entries.edit.details', function (&$context) {
509
+            $view->hook('cp.entries.edit.details', function(&$context) {
510 510
                 /** @var  Element $element */
511 511
                 $element = $context['entry'] ?? null;
512 512
 
513 513
                 return $this->renderSidebar($element);
514 514
             });
515 515
             // Category Groups sidebar
516
-            $view->hook('cp.categories.edit.details', function (&$context) {
516
+            $view->hook('cp.categories.edit.details', function(&$context) {
517 517
                 /** @var  Element $element */
518 518
                 $element = $context['category'] ?? null;
519 519
 
520 520
                 return $this->renderSidebar($element);
521 521
             });
522 522
             // Commerce Product Types sidebar
523
-            $view->hook('cp.commerce.product.edit.details', function (&$context) {
523
+            $view->hook('cp.commerce.product.edit.details', function(&$context) {
524 524
                 /** @var  Element $element */
525 525
                 $element = $context['product'] ?? null;
526 526
 
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
     {
725 725
         $cache = Craft::$app->getCache();
726 726
         // See if there are any recommendations to add as a badge
727
-        $recommendations = $cache->getOrSet(self::RECOMMENDATIONS_CACHE_KEY, function () {
727
+        $recommendations = $cache->getOrSet(self::RECOMMENDATIONS_CACHE_KEY, function() {
728 728
             $data = [];
729 729
             $now = new \DateTime();
730 730
             $end = $now->format('Y-m-d');
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
             $recommendations = '';
743 743
         }
744 744
 
745
-        return (string)$recommendations;
745
+        return (string) $recommendations;
746 746
     }
747 747
 
748 748
     /**
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
     {
755 755
         $cache = Craft::$app->getCache();
756 756
         // See if there are any recommendations to add as a badge
757
-        $errors = $cache->getOrSet(self::ERRORS_CACHE_KEY, function () {
757
+        $errors = $cache->getOrSet(self::ERRORS_CACHE_KEY, function() {
758 758
             $now = new \DateTime();
759 759
             $end = $now->format('Y-m-d');
760 760
             $start = $now->modify('-30 days')->format('Y-m-d');
@@ -768,6 +768,6 @@  discard block
 block discarded – undo
768 768
             $errors = '⚠';
769 769
         }
770 770
 
771
-        return (string)$errors;
771
+        return (string) $errors;
772 772
     }
773 773
 }
Please login to merge, or discard this patch.