Passed
Branch v1 (eb0178)
by Andrew
08:09
created
src/helpers/MultiSite.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             } else {
113 113
                 $variables['sitesMenuLabel'] = Craft::t(
114 114
                     'site',
115
-                    $sites->getSiteById((int)$variables['currentSiteId'])->name
115
+                    $sites->getSiteById((int) $variables['currentSiteId'])->name
116 116
                 );
117 117
             }
118 118
         } else {
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
             }
173 173
 
174 174
             if (($parsed = parse_url(self::getBaseUrl($site))) === false) {
175
-                Craft::warning('Unable to parse the site base URL: ' . $site->baseUrl);
175
+                Craft::warning('Unable to parse the site base URL: '.$site->baseUrl);
176 176
                 continue;
177 177
             }
178 178
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
             // Does the site URL specify a base path?
185 185
             $parsedPath = !empty($parsed['path']) ? self::normalizePath($parsed['path']) : '';
186
-            if ($parsedPath && strpos($fullUri . '/', $parsedPath . '/') !== 0) {
186
+            if ($parsedPath && strpos($fullUri.'/', $parsedPath.'/') !== 0) {
187 187
                 continue;
188 188
             }
189 189
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     protected static function getBaseUrl(Site $site)
258 258
     {
259 259
         if ($site->baseUrl) {
260
-            return rtrim(self::parseEnv($site->baseUrl), '/') . '/';
260
+            return rtrim(self::parseEnv($site->baseUrl), '/').'/';
261 261
         }
262 262
 
263 263
         return null;
Please login to merge, or discard this patch.
src/Webperf.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
         Event::on(
362 362
             Plugins::class,
363 363
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
364
-            function (PluginEvent $event) {
364
+            function(PluginEvent $event) {
365 365
                 if ($event->plugin === $this) {
366 366
                     // Invalidate our caches after we've been installed
367 367
                     $this->clearAllCaches();
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
         Event::on(
390 390
             CraftVariable::class,
391 391
             CraftVariable::EVENT_INIT,
392
-            function (Event $event) {
392
+            function(Event $event) {
393 393
                 /** @var CraftVariable $variable */
394 394
                 $variable = $event->sender;
395 395
                 $variable->set('webperf', [
@@ -402,11 +402,11 @@  discard block
 block discarded – undo
402 402
         Event::on(
403 403
             Plugins::class,
404 404
             Plugins::EVENT_AFTER_LOAD_PLUGINS,
405
-            function () {
405
+            function() {
406 406
                 // Install these only after all other plugins have loaded
407 407
                 $request = Craft::$app->getRequest();
408 408
                 // Only respond to non-console site requests
409
-                if ($request->getIsSiteRequest() && !$request->getIsConsoleRequest()  && !$request->getIsLivePreview()) {
409
+                if ($request->getIsSiteRequest() && !$request->getIsConsoleRequest() && !$request->getIsLivePreview()) {
410 410
                     $this->handleSiteRequest();
411 411
                 }
412 412
                 // Respond to Control Panel requests
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
         Event::on(
427 427
             UrlManager::class,
428 428
             UrlManager::EVENT_REGISTER_SITE_URL_RULES,
429
-            function (RegisterUrlRulesEvent $event) {
429
+            function(RegisterUrlRulesEvent $event) {
430 430
                 Craft::debug(
431 431
                     'UrlManager::EVENT_REGISTER_SITE_URL_RULES',
432 432
                     __METHOD__
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
         Event::on(
450 450
             UrlManager::class,
451 451
             UrlManager::EVENT_REGISTER_CP_URL_RULES,
452
-            function (RegisterUrlRulesEvent $event) {
452
+            function(RegisterUrlRulesEvent $event) {
453 453
                 Craft::debug(
454 454
                     'UrlManager::EVENT_REGISTER_CP_URL_RULES',
455 455
                     __METHOD__
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
         Event::on(
466 466
             UserPermissions::class,
467 467
             UserPermissions::EVENT_REGISTER_PERMISSIONS,
468
-            function (RegisterUserPermissionsEvent $event) {
468
+            function(RegisterUserPermissionsEvent $event) {
469 469
                 Craft::debug(
470 470
                     'UserPermissions::EVENT_REGISTER_PERMISSIONS',
471 471
                     __METHOD__
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
             Event::on(
496 496
                 View::class,
497 497
                 View::EVENT_END_PAGE,
498
-                function () {
498
+                function() {
499 499
                     Craft::debug(
500 500
                         'View::EVENT_END_PAGE',
501 501
                         __METHOD__
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
             Event::on(
524 524
                 View::class,
525 525
                 View::EVENT_END_BODY,
526
-                function () {
526
+                function() {
527 527
                     Craft::debug(
528 528
                         'View::EVENT_END_BODY',
529 529
                         __METHOD__
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
             Event::on(
547 547
                 Application::class,
548 548
                 Application::EVENT_AFTER_REQUEST,
549
-                function () {
549
+                function() {
550 550
                     Craft::debug(
551 551
                         'Application::EVENT_AFTER_REQUEST',
552 552
                         __METHOD__
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
         if (self::$settings->displaySidebar && $currentUser && $currentUser->can('webperf:sidebar')) {
573 573
             $view = Craft::$app->getView();
574 574
             // Entries sidebar
575
-            $view->hook('cp.entries.edit.details', function (&$context) {
575
+            $view->hook('cp.entries.edit.details', function(&$context) {
576 576
                 /** @var  Element $element */
577 577
                 $element = $context['entry'] ?? null;
578 578
                 $html = '';
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
                 return $html;
584 584
             });
585 585
             // Category Groups sidebar
586
-            $view->hook('cp.categories.edit.details', function (&$context) {
586
+            $view->hook('cp.categories.edit.details', function(&$context) {
587 587
                 /** @var  Element $element */
588 588
                 $element = $context['category'] ?? null;
589 589
                 $html = '';
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
                 return $html;
595 595
             });
596 596
             // Commerce Product Types sidebar
597
-            $view->hook('cp.commerce.product.edit.details', function (&$context) {
597
+            $view->hook('cp.commerce.product.edit.details', function(&$context) {
598 598
                 /** @var  Element $element */
599 599
                 $element = $context['product'] ?? null;
600 600
                 $html = '';
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
     {
789 789
         $cache = Craft::$app->getCache();
790 790
         // See if there are any recommendations to add as a badge
791
-        $recommendations = $cache->getOrSet(self::RECOMMENDATIONS_CACHE_KEY, function () {
791
+        $recommendations = $cache->getOrSet(self::RECOMMENDATIONS_CACHE_KEY, function() {
792 792
             $data = [];
793 793
             $now = new \DateTime();
794 794
             $end = $now->format('Y-m-d');
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
             $recommendations = '';
807 807
         }
808 808
 
809
-        return (string)$recommendations;
809
+        return (string) $recommendations;
810 810
     }
811 811
 
812 812
     /**
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
     {
819 819
         $cache = Craft::$app->getCache();
820 820
         // See if there are any recommendations to add as a badge
821
-        $errors = $cache->getOrSet(self::ERRORS_CACHE_KEY, function () {
821
+        $errors = $cache->getOrSet(self::ERRORS_CACHE_KEY, function() {
822 822
             $now = new \DateTime();
823 823
             $end = $now->format('Y-m-d');
824 824
             $start = $now->modify('-30 days')->format('Y-m-d');
@@ -832,6 +832,6 @@  discard block
 block discarded – undo
832 832
             $errors = '⚠';
833 833
         }
834 834
 
835
-        return (string)$errors;
835
+        return (string) $errors;
836 836
     }
837 837
 }
Please login to merge, or discard this patch.