Test Failed
Push — v5 ( a2f6fe...cc9616 )
by Andrew
46:10 queued 21:16
created
src/services/MetaContainers.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
         // Get the page number of this request
183 183
         $request = Craft::$app->getRequest();
184 184
         if (!$request->isConsoleRequest) {
185
-            $this->paginationPage = (string)$request->pageNum;
185
+            $this->paginationPage = (string) $request->pageNum;
186 186
         }
187 187
     }
188 188
 
@@ -251,10 +251,10 @@  discard block
 block discarded – undo
251 251
         $dependency = $this->containerDependency;
252 252
         $uniqueKey = $dependency->tags[3] ?? self::GLOBALS_CACHE_KEY;
253 253
         list($this->metaGlobalVars, $this->metaSiteVars) = Craft::$app->getCache()->getOrSet(
254
-            self::GLOBALS_CACHE_KEY . $uniqueKey,
254
+            self::GLOBALS_CACHE_KEY.$uniqueKey,
255 255
             function() use ($uniqueKey) {
256 256
                 Craft::info(
257
-                    self::GLOBALS_CACHE_KEY . ' cache miss: ' . $uniqueKey,
257
+                    self::GLOBALS_CACHE_KEY.' cache miss: '.$uniqueKey,
258 258
                     __METHOD__
259 259
                 );
260 260
 
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
                     ?? 1;
381 381
             }
382 382
             // Handle pagination
383
-            $paginationPage = 'page' . $this->paginationPage;
383
+            $paginationPage = 'page'.$this->paginationPage;
384 384
             // Get the path for the current request
385 385
             $request = Craft::$app->getRequest();
386 386
             $requestPath = '/';
@@ -405,22 +405,22 @@  discard block
 block discarded – undo
405 405
                 }
406 406
             }
407 407
             // Get our cache key
408
-            $cacheKey = $uri . $siteId . $paginationPage . $requestPath . $this->getAllowedUrlParams() . $token;
408
+            $cacheKey = $uri.$siteId.$paginationPage.$requestPath.$this->getAllowedUrlParams().$token;
409 409
             // For requests with a status code of >= 400, use one cache key
410 410
             if (!$request->isConsoleRequest) {
411 411
                 $response = Craft::$app->getResponse();
412 412
                 if ($response->statusCode >= 400) {
413
-                    $cacheKey = $siteId . self::INVALID_RESPONSE_CACHE_KEY . $response->statusCode;
413
+                    $cacheKey = $siteId.self::INVALID_RESPONSE_CACHE_KEY.$response->statusCode;
414 414
                 }
415 415
             }
416 416
             // Load the meta containers
417 417
             $dependency = new TagDependency([
418 418
                 'tags' => [
419 419
                     self::GLOBAL_METACONTAINER_CACHE_TAG,
420
-                    self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId,
421
-                    self::METACONTAINER_CACHE_TAG . $uri . $siteId,
422
-                    self::METACONTAINER_CACHE_TAG . $cacheKey,
423
-                    self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType,
420
+                    self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId,
421
+                    self::METACONTAINER_CACHE_TAG.$uri.$siteId,
422
+                    self::METACONTAINER_CACHE_TAG.$cacheKey,
423
+                    self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType,
424 424
                 ],
425 425
             ]);
426 426
             $this->containerDependency = $dependency;
@@ -437,10 +437,10 @@  discard block
 block discarded – undo
437 437
             } else {
438 438
                 $cache = Craft::$app->getCache();
439 439
                 list($this->metaGlobalVars, $this->metaSiteVars, $this->metaSitemapVars, $this->metaContainers) = $cache->getOrSet(
440
-                    self::CACHE_KEY . $cacheKey,
440
+                    self::CACHE_KEY.$cacheKey,
441 441
                     function() use ($uri, $siteId) {
442 442
                         Craft::info(
443
-                            'Meta container cache miss: ' . $uri . '/' . $siteId,
443
+                            'Meta container cache miss: '.$uri.'/'.$siteId,
444 444
                             __METHOD__
445 445
                         );
446 446
                         $this->loadGlobalMetaContainers($siteId);
@@ -841,10 +841,10 @@  discard block
 block discarded – undo
841 841
         $cache = Craft::$app->getCache();
842 842
         TagDependency::invalidate(
843 843
             $cache,
844
-            self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId
844
+            self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId
845 845
         );
846 846
         Craft::info(
847
-            'Meta bundle cache cleared: ' . $metaBundleSourceId . ' / ' . $metaBundleSourceType . ' / ' . $siteId,
847
+            'Meta bundle cache cleared: '.$metaBundleSourceId.' / '.$metaBundleSourceType.' / '.$siteId,
848 848
             __METHOD__
849 849
         );
850 850
         // Trigger an event to let other plugins/modules know we've cleared our caches
@@ -871,9 +871,9 @@  discard block
 block discarded – undo
871 871
         if ($siteId === null) {
872 872
             $siteId = Craft::$app->getSites()->currentSite->id ?? 1;
873 873
         }
874
-        TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG . $uri . $siteId);
874
+        TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG.$uri.$siteId);
875 875
         Craft::info(
876
-            'Meta container cache cleared: ' . $uri . ' / ' . $siteId,
876
+            'Meta container cache cleared: '.$uri.' / '.$siteId,
877 877
             __METHOD__
878 878
         );
879 879
         // Trigger an event to let other plugins/modules know we've cleared our caches
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
 
1017 1017
                     // Handle re-creating the `mainEntityOfPage` so that the model injected into the
1018 1018
                     // templates has the appropriate attributes
1019
-                    $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE . JsonLdService::GENERAL_HANDLE;
1019
+                    $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE.JsonLdService::GENERAL_HANDLE;
1020 1020
                     $generalContainer = $this->metaContainers[$generalContainerKey];
1021 1021
                     if (($generalContainer !== null) && !empty($generalContainer->data['mainEntityOfPage'])) {
1022 1022
                         /** @var MetaJsonLd $jsonLdModel */
Please login to merge, or discard this patch.
src/helpers/Sitemap.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         if ($multiSite) {
138 138
             $urlsetLine .= ' xmlns:xhtml="http://www.w3.org/1999/xhtml"';
139 139
         }
140
-        if ((bool)$metaBundle->metaSitemapVars->newsSitemap) {
140
+        if ((bool) $metaBundle->metaSitemapVars->newsSitemap) {
141 141
             $urlsetLine .= ' xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"';
142 142
         }
143 143
         $urlsetLine .= '>';
@@ -213,13 +213,13 @@  discard block
 block discarded – undo
213 213
                         $paginator->getTotalPages(),
214 214
                         $paginator->getTotalResults());
215 215
                 }
216
-                echo $message . PHP_EOL;
216
+                echo $message.PHP_EOL;
217 217
             }
218 218
             /** @var Element $element */
219 219
             foreach ($elements as $element) {
220 220
                 // Output some info if this is a console app
221 221
                 if (Craft::$app instanceof ConsoleApplication) {
222
-                    echo "Processing element {$currentElement}/{$totalElements} - {$element->title}" . PHP_EOL;
222
+                    echo "Processing element {$currentElement}/{$totalElements} - {$element->title}".PHP_EOL;
223 223
                 }
224 224
 
225 225
                 $metaBundle->metaSitemapVars->setAttributes($stashedSitemapAttrs, false);
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                         }
265 265
                         $canonicalUrl = UrlHelper::absoluteUrlWithProtocol($canonicalUrl);
266 266
                         if ($url !== $canonicalUrl) {
267
-                            Craft::info("Excluding URL: {$url} from the sitemap because it does not match the Canonical URL: {$canonicalUrl} - " . $metaBundle->metaGlobalVars->canonicalUrl . " - " . $element->uri);
267
+                            Craft::info("Excluding URL: {$url} from the sitemap because it does not match the Canonical URL: {$canonicalUrl} - ".$metaBundle->metaGlobalVars->canonicalUrl." - ".$element->uri);
268 268
                             continue;
269 269
                         }
270 270
                     }
@@ -322,12 +322,12 @@  discard block
 block discarded – undo
322 322
                                             if ($primarySiteId === $altSourceSiteId && Seomatic::$settings->addXDefaultHrefLang) {
323 323
                                                 $lines[] = '<xhtml:link rel="alternate"'
324 324
                                                     . ' hreflang="x-default"'
325
-                                                    . ' href="' . self::encodeSitemapEntity($altUrl) . '"'
325
+                                                    . ' href="'.self::encodeSitemapEntity($altUrl).'"'
326 326
                                                     . ' />';
327 327
                                             }
328 328
                                             $lines[] = '<xhtml:link rel="alternate"'
329
-                                                . ' hreflang="' . $altSiteSettings['language'] . '"'
330
-                                                . ' href="' . self::encodeSitemapEntity($altUrl) . '"'
329
+                                                . ' hreflang="'.$altSiteSettings['language'].'"'
330
+                                                . ' href="'.self::encodeSitemapEntity($altUrl).'"'
331 331
                                                 . ' />';
332 332
                                         }
333 333
                                     }
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
                         }
337 337
                     }
338 338
                     // Handle news sitemaps https://developers.google.com/search/docs/crawling-indexing/sitemaps/news-sitemap
339
-                    if ((bool)$metaBundle->metaSitemapVars->newsSitemap) {
339
+                    if ((bool) $metaBundle->metaSitemapVars->newsSitemap) {
340 340
                         $now = new DateTime();
341 341
                         $interval = $now->diff($dateUpdated);
342 342
                         if ($interval->days <= 2) {
@@ -346,11 +346,11 @@  discard block
 block discarded – undo
346 346
                             }
347 347
                             $lines[] = '<news:news>';
348 348
                             $lines[] = '<news:publication>';
349
-                            $lines[] = '<news:name>' . self::encodeSitemapEntity($metaBundle->metaSitemapVars->newsPublicationName) . '</news:name>';
350
-                            $lines[] = '<news:language>' . $language . '</news:language>';
349
+                            $lines[] = '<news:name>'.self::encodeSitemapEntity($metaBundle->metaSitemapVars->newsPublicationName).'</news:name>';
350
+                            $lines[] = '<news:language>'.$language.'</news:language>';
351 351
                             $lines[] = '</news:publication>';
352
-                            $lines[] = '<news:publication_date>' . $dateUpdated->format(DateTime::W3C) . '</news:publication_date>';
353
-                            $lines[] = '<news:title>' . self::encodeSitemapEntity($element->title) . '</news:title>';
352
+                            $lines[] = '<news:publication_date>'.$dateUpdated->format(DateTime::W3C).'</news:publication_date>';
353
+                            $lines[] = '<news:title>'.self::encodeSitemapEntity($element->title).'</news:title>';
354 354
                             $lines[] = '</news:news>';
355 355
                         }
356 356
                     }
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 
572 572
                         $attributes = array_intersect_key(
573 573
                             $attributes,
574
-                            array_flip((array)$seoSettingsField->sitemapEnabledFields)
574
+                            array_flip((array) $seoSettingsField->sitemapEnabledFields)
575 575
                         );
576 576
                         $attributes = array_filter(
577 577
                             $attributes,
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
      */
604 604
     protected static function assetSitemapItem(Asset $asset, MetaBundle $metaBundle, array &$lines)
605 605
     {
606
-        if ((bool)$asset->enabledForSite && $asset->getUrl() !== null) {
606
+        if ((bool) $asset->enabledForSite && $asset->getUrl() !== null) {
607 607
             switch ($asset->kind) {
608 608
                 case 'image':
609 609
                     $transform = Craft::$app->getImageTransforms()->getTransformByHandle($metaBundle->metaSitemapVars->sitemapAssetTransform ?? '');
@@ -616,9 +616,9 @@  discard block
 block discarded – undo
616 616
                         $fieldName = $row['field'] ?? '';
617 617
                         $propName = $row['property'] ?? '';
618 618
                         if (!empty($fieldName) && !empty($asset[$fieldName]) && !empty($propName)) {
619
-                            $lines[] = '<image:' . $propName . '>';
619
+                            $lines[] = '<image:'.$propName.'>';
620 620
                             $lines[] = self::encodeSitemapEntity($asset[$fieldName]);
621
-                            $lines[] = '</image:' . $propName . '>';
621
+                            $lines[] = '</image:'.$propName.'>';
622 622
                         }
623 623
                     }
624 624
                     $lines[] = '</image:image>';
@@ -634,9 +634,9 @@  discard block
 block discarded – undo
634 634
                         $fieldName = $row['field'] ?? '';
635 635
                         $propName = $row['property'] ?? '';
636 636
                         if (!empty($fieldName) && !empty($asset[$fieldName]) && !empty($propName)) {
637
-                            $lines[] = '<video:' . $propName . '>';
637
+                            $lines[] = '<video:'.$propName.'>';
638 638
                             $lines[] = self::encodeSitemapEntity($asset[$fieldName]);
639
-                            $lines[] = '</video:' . $propName . '>';
639
+                            $lines[] = '</video:'.$propName.'>';
640 640
                         }
641 641
                     }
642 642
                     $lines[] = '</video:video>';
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
      */
653 653
     protected static function assetFilesSitemapLink(Asset $asset, MetaBundle $metaBundle, array &$lines)
654 654
     {
655
-        if ((bool)$asset->enabledForSite && $asset->getUrl() !== null) {
655
+        if ((bool) $asset->enabledForSite && $asset->getUrl() !== null) {
656 656
             if (in_array($asset->kind, SitemapTemplate::FILE_TYPES, false)) {
657 657
                 $dateUpdated = $asset->dateUpdated ?? $asset->dateCreated ?? new DateTime();
658 658
                 $lines[] = '<url>';
Please login to merge, or discard this patch.
src/Seomatic.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
             $lastSegment = end($segments);
348 348
             $site = Craft::$app->getSites()->getSiteByHandle($lastSegment);
349 349
             if ($site !== null) {
350
-                $siteSuffix = '/' . $lastSegment;
350
+                $siteSuffix = '/'.$lastSegment;
351 351
             }
352 352
         }
353 353
         $currentUser = Craft::$app->getUser()->getIdentity();
@@ -355,31 +355,31 @@  discard block
 block discarded – undo
355 355
         if ($currentUser->can('seomatic:dashboard')) {
356 356
             $subNavs['dashboard'] = [
357 357
                 'label' => Craft::t('seomatic', 'Dashboard'),
358
-                'url' => 'seomatic/dashboard' . $siteSuffix,
358
+                'url' => 'seomatic/dashboard'.$siteSuffix,
359 359
             ];
360 360
         }
361 361
         if ($currentUser->can('seomatic:global-meta')) {
362 362
             $subNavs['global'] = [
363 363
                 'label' => Craft::t('seomatic', 'Global SEO'),
364
-                'url' => 'seomatic/global/general' . $siteSuffix,
364
+                'url' => 'seomatic/global/general'.$siteSuffix,
365 365
             ];
366 366
         }
367 367
         if ($currentUser->can('seomatic:content-meta')) {
368 368
             $subNavs['content'] = [
369 369
                 'label' => Craft::t('seomatic', 'Content SEO'),
370
-                'url' => 'seomatic/content' . $siteSuffix,
370
+                'url' => 'seomatic/content'.$siteSuffix,
371 371
             ];
372 372
         }
373 373
         if ($currentUser->can('seomatic:site-settings')) {
374 374
             $subNavs['site'] = [
375 375
                 'label' => Craft::t('seomatic', 'Site Settings'),
376
-                'url' => 'seomatic/site/identity' . $siteSuffix,
376
+                'url' => 'seomatic/site/identity'.$siteSuffix,
377 377
             ];
378 378
         }
379 379
         if ($currentUser->can('seomatic:tracking-scripts')) {
380 380
             $subNavs['tracking'] = [
381 381
                 'label' => Craft::t('seomatic', 'Tracking Scripts'),
382
-                'url' => 'seomatic/tracking/gtag' . $siteSuffix,
382
+                'url' => 'seomatic/tracking/gtag'.$siteSuffix,
383 383
             ];
384 384
         }
385 385
         $editableSettings = true;
@@ -573,14 +573,14 @@  discard block
 block discarded – undo
573 573
                     $element = $e->sender;
574 574
                     if ($element->uri !== null) {
575 575
                         $e->previewTargets[] = [
576
-                            'label' => '
Please login to merge, or discard this patch.