Passed
Push — develop-v4 ( 01c404...563ce7 )
by Andrew
18:55 queued 08:57
created
src/models/MetaScriptContainer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
         }
57 57
         $tagData = $cache->getOrSet(
58 58
             self::CONTAINER_TYPE.$uniqueKey,
59
-            function () use ($uniqueKey) {
59
+            function() use ($uniqueKey) {
60 60
                 Craft::info(
61 61
                     self::CONTAINER_TYPE.' cache miss: '.$uniqueKey,
62 62
                     __METHOD__
Please login to merge, or discard this patch.
src/services/MetaContainers.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         // Get the page number of this request
161 161
         $request = Craft::$app->getRequest();
162 162
         if (!$request->isConsoleRequest) {
163
-            $this->paginationPage = (string)$request->pageNum;
163
+            $this->paginationPage = (string) $request->pageNum;
164 164
         }
165 165
     }
166 166
 
@@ -176,10 +176,10 @@  discard block
 block discarded – undo
176 176
         $uniqueKey = $dependency->tags[3] ?? self::GLOBALS_CACHE_KEY;
177 177
         $uniqueKey .= $bodyPosition;
178 178
         $scriptData = Craft::$app->getCache()->getOrSet(
179
-            self::GLOBALS_CACHE_KEY . $uniqueKey,
180
-            function () use ($uniqueKey, $bodyPosition) {
179
+            self::GLOBALS_CACHE_KEY.$uniqueKey,
180
+            function() use ($uniqueKey, $bodyPosition) {
181 181
                 Craft::info(
182
-                    self::SCRIPTS_CACHE_KEY . ' cache miss: ' . $uniqueKey,
182
+                    self::SCRIPTS_CACHE_KEY.' cache miss: '.$uniqueKey,
183 183
                     __METHOD__
184 184
                 );
185 185
                 $scriptData = [];
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
                             foreach ($scriptContainer->data as $metaScript) {
192 192
                                 /** @var MetaScript $metaScript */
193 193
                                 if (!empty($metaScript->bodyTemplatePath)
194
-                                    && ((int)$metaScript->bodyPosition === $bodyPosition)) {
194
+                                    && ((int) $metaScript->bodyPosition === $bodyPosition)) {
195 195
                                     $scriptData[] = $metaScript->renderBodyHtml();
196 196
                                 }
197 197
                             }
@@ -271,10 +271,10 @@  discard block
 block discarded – undo
271 271
         $dependency = $this->containerDependency;
272 272
         $uniqueKey = $dependency->tags[3] ?? self::GLOBALS_CACHE_KEY;
273 273
         list($this->metaGlobalVars, $this->metaSiteVars) = Craft::$app->getCache()->getOrSet(
274
-            self::GLOBALS_CACHE_KEY . $uniqueKey,
275
-            function () use ($uniqueKey) {
274
+            self::GLOBALS_CACHE_KEY.$uniqueKey,
275
+            function() use ($uniqueKey) {
276 276
                 Craft::info(
277
-                    self::GLOBALS_CACHE_KEY . ' cache miss: ' . $uniqueKey,
277
+                    self::GLOBALS_CACHE_KEY.' cache miss: '.$uniqueKey,
278 278
                     __METHOD__
279 279
                 );
280 280
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
                     ?? 1;
396 396
             }
397 397
             // Handle pagination
398
-            $paginationPage = 'page' . $this->paginationPage;
398
+            $paginationPage = 'page'.$this->paginationPage;
399 399
             // Get the path for the current request
400 400
             $request = Craft::$app->getRequest();
401 401
             $requestPath = '/';
@@ -411,21 +411,21 @@  discard block
 block discarded – undo
411 411
                 }
412 412
             }
413 413
             // Get our cache key
414
-            $cacheKey = $uri . $siteId . $paginationPage . $requestPath . $this->getAllowedUrlParams();
414
+            $cacheKey = $uri.$siteId.$paginationPage.$requestPath.$this->getAllowedUrlParams();
415 415
             // For requests with a status code of >= 400, use one cache key
416 416
             if (!$request->isConsoleRequest) {
417 417
                 $response = Craft::$app->getResponse();
418 418
                 if ($response->statusCode >= 400) {
419
-                    $cacheKey = $siteId . self::INVALID_RESPONSE_CACHE_KEY . $response->statusCode;
419
+                    $cacheKey = $siteId.self::INVALID_RESPONSE_CACHE_KEY.$response->statusCode;
420 420
                 }
421 421
             }
422 422
             // Load the meta containers
423 423
             $dependency = new TagDependency([
424 424
                 'tags' => [
425 425
                     self::GLOBAL_METACONTAINER_CACHE_TAG,
426
-                    self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId,
427
-                    self::METACONTAINER_CACHE_TAG . $uri . $siteId,
428
-                    self::METACONTAINER_CACHE_TAG . $cacheKey,
426
+                    self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId,
427
+                    self::METACONTAINER_CACHE_TAG.$uri.$siteId,
428
+                    self::METACONTAINER_CACHE_TAG.$cacheKey,
429 429
                 ],
430 430
             ]);
431 431
             $this->containerDependency = $dependency;
@@ -441,10 +441,10 @@  discard block
 block discarded – undo
441 441
             } else {
442 442
                 $cache = Craft::$app->getCache();
443 443
                 list($this->metaGlobalVars, $this->metaSiteVars, $this->metaSitemapVars, $this->metaContainers) = $cache->getOrSet(
444
-                    self::CACHE_KEY . $cacheKey,
445
-                    function () use ($uri, $siteId) {
444
+                    self::CACHE_KEY.$cacheKey,
445
+                    function() use ($uri, $siteId) {
446 446
                         Craft::info(
447
-                            'Meta container cache miss: ' . $uri . '/' . $siteId,
447
+                            'Meta container cache miss: '.$uri.'/'.$siteId,
448 448
                             __METHOD__
449 449
                         );
450 450
                         $this->loadGlobalMetaContainers($siteId);
@@ -839,10 +839,10 @@  discard block
 block discarded – undo
839 839
         $cache = Craft::$app->getCache();
840 840
         TagDependency::invalidate(
841 841
             $cache,
842
-            self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId
842
+            self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId
843 843
         );
844 844
         Craft::info(
845
-            'Meta bundle cache cleared: ' . $metaBundleSourceId . ' / ' . $metaBundleSourceType . ' / ' . $siteId,
845
+            'Meta bundle cache cleared: '.$metaBundleSourceId.' / '.$metaBundleSourceType.' / '.$siteId,
846 846
             __METHOD__
847 847
         );
848 848
         // Trigger an event to let other plugins/modules know we've cleared our caches
@@ -869,9 +869,9 @@  discard block
 block discarded – undo
869 869
         if ($siteId === null) {
870 870
             $siteId = Craft::$app->getSites()->currentSite->id ?? 1;
871 871
         }
872
-        TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG . $uri . $siteId);
872
+        TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG.$uri.$siteId);
873 873
         Craft::info(
874
-            'Meta container cache cleared: ' . $uri . ' / ' . $siteId,
874
+            'Meta container cache cleared: '.$uri.' / '.$siteId,
875 875
             __METHOD__
876 876
         );
877 877
         // Trigger an event to let other plugins/modules know we've cleared our caches
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
 
989 989
                     // Handle re-creating the `mainEntityOfPage` so that the model injected into the
990 990
                     // templates has the appropriate attributes
991
-                    $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE . JsonLdService::GENERAL_HANDLE;
991
+                    $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE.JsonLdService::GENERAL_HANDLE;
992 992
                     $generalContainer = $this->metaContainers[$generalContainerKey];
993 993
                     if (($generalContainer !== null) && !empty($generalContainer->data['mainEntityOfPage'])) {
994 994
                         /** @var MetaJsonLd $jsonLdModel */
Please login to merge, or discard this patch.
src/Seomatic.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
             $lastSegment = end($segments);
344 344
             $site = Craft::$app->getSites()->getSiteByHandle($lastSegment);
345 345
             if ($site !== null) {
346
-                $siteSuffix = '/' . $lastSegment;
346
+                $siteSuffix = '/'.$lastSegment;
347 347
             }
348 348
         }
349 349
         $currentUser = Craft::$app->getUser()->getIdentity();
@@ -351,31 +351,31 @@  discard block
 block discarded – undo
351 351
         if ($currentUser->can('seomatic:dashboard')) {
352 352
             $subNavs['dashboard'] = [
353 353
                 'label' => Craft::t('seomatic', 'Dashboard'),
354
-                'url' => 'seomatic/dashboard' . $siteSuffix,
354
+                'url' => 'seomatic/dashboard'.$siteSuffix,
355 355
             ];
356 356
         }
357 357
         if ($currentUser->can('seomatic:global-meta')) {
358 358
             $subNavs['global'] = [
359 359
                 'label' => Craft::t('seomatic', 'Global SEO'),
360
-                'url' => 'seomatic/global/general' . $siteSuffix,
360
+                'url' => 'seomatic/global/general'.$siteSuffix,
361 361
             ];
362 362
         }
363 363
         if ($currentUser->can('seomatic:content-meta')) {
364 364
             $subNavs['content'] = [
365 365
                 'label' => Craft::t('seomatic', 'Content SEO'),
366
-                'url' => 'seomatic/content' . $siteSuffix,
366
+                'url' => 'seomatic/content'.$siteSuffix,
367 367
             ];
368 368
         }
369 369
         if ($currentUser->can('seomatic:site-settings')) {
370 370
             $subNavs['site'] = [
371 371
                 'label' => Craft::t('seomatic', 'Site Settings'),
372
-                'url' => 'seomatic/site/identity' . $siteSuffix,
372
+                'url' => 'seomatic/site/identity'.$siteSuffix,
373 373
             ];
374 374
         }
375 375
         if ($currentUser->can('seomatic:tracking-scripts')) {
376 376
             $subNavs['tracking'] = [
377 377
                 'label' => Craft::t('seomatic', 'Tracking Scripts'),
378
-                'url' => 'seomatic/tracking/gtag' . $siteSuffix,
378
+                'url' => 'seomatic/tracking/gtag'.$siteSuffix,
379 379
             ];
380 380
         }
381 381
         $editableSettings = true;
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
         Event::on(
421 421
             Plugins::class,
422 422
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
423
-            function (PluginEvent $event) {
423
+            function(PluginEvent $event) {
424 424
                 if ($event->plugin === $this) {
425 425
                     // Invalidate our caches after we've been installed
426 426
                     $this->clearAllCaches();
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
         Event::on(
442 442
             ClearCaches::class,
443 443
             ClearCaches::EVENT_REGISTER_CACHE_OPTIONS,
444
-            function (RegisterCacheOptionsEvent $event) {
444
+            function(RegisterCacheOptionsEvent $event) {
445 445
                 Craft::debug(
446 446
                     'ClearCaches::EVENT_REGISTER_CACHE_OPTIONS',
447 447
                     __METHOD__
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
         Event::on(
458 458
             Plugins::class,
459 459
             Plugins::EVENT_BEFORE_SAVE_PLUGIN_SETTINGS,
460
-            function (PluginEvent $event) {
460
+            function(PluginEvent $event) {
461 461
                 if ($event->plugin === $this && !Craft::$app->getDb()->getSupportsMb4()) {
462 462
                     // For all the emojis
463 463
                     $settingsModel = $this->getSettings();
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
         Event::on(
488 488
             Plugins::class,
489 489
             Plugins::EVENT_AFTER_LOAD_PLUGINS,
490
-            function () {
490
+            function() {
491 491
                 // Delay registering SEO Elements to give other plugins a chance to load first
492 492
                 $this->seoElements->getAllSeoElementTypes(false);
493 493
                 // Delay installing GQL handlers to give other plugins a chance to register their own first
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
         Event::on(
509 509
             Fields::class,
510 510
             Fields::EVENT_REGISTER_FIELD_TYPES,
511
-            static function (RegisterComponentTypesEvent $event) {
511
+            static function(RegisterComponentTypesEvent $event) {
512 512
                 $event->types[] = SeoSettingsField::class;
513 513
                 $event->types[] = Seomatic_MetaField::class;
514 514
             }
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
         Event::on(
518 518
             Elements::class,
519 519
             Elements::EVENT_AFTER_SAVE_ELEMENT,
520
-            static function (ElementEvent $event) {
520
+            static function(ElementEvent $event) {
521 521
                 Craft::debug(
522 522
                     'Elements::EVENT_AFTER_SAVE_ELEMENT',
523 523
                     __METHOD__
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
         Event::on(
538 538
             Elements::class,
539 539
             Elements::EVENT_AFTER_DELETE_ELEMENT,
540
-            static function (ElementEvent $event) {
540
+            static function(ElementEvent $event) {
541 541
                 Craft::debug(
542 542
                     'Elements::EVENT_AFTER_DELETE_ELEMENT',
543 543
                     __METHOD__
@@ -556,19 +556,19 @@  discard block
 block discarded – undo
556 556
             Event::on(
557 557
                 Entry::class,
558 558
                 Element::EVENT_REGISTER_PREVIEW_TARGETS,
559
-                static function (RegisterPreviewTargetsEvent $e) {
559
+                static function(RegisterPreviewTargetsEvent $e) {
560 560
                     /** @var Element $element */
561 561
                     $element = $e->sender;
562 562
                     if ($element->uri !== null) {
563 563
                         $e->previewTargets[] = [
564
-                            'label' => '
Please login to merge, or discard this patch.