Passed
Push — v3 ( ebf6a0...ab1a47 )
by Andrew
11:45 queued 15s
created
src/fields/SeoSettings.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
         if ($element !== null && $element->uri !== null) {
377 377
             $siteId = $element->siteId;
378 378
             $uri = $element->uri;
379
-            $cacheKey = self::CACHE_KEY . $uri . $siteId . $this->elementDisplayPreviewType;
379
+            $cacheKey = self::CACHE_KEY.$uri.$siteId.$this->elementDisplayPreviewType;
380 380
             $metaBundleSourceType = Seomatic::$plugin->seoElements->getMetaBundleTypeFromElement($element);
381 381
             $seoElement = Seomatic::$plugin->seoElements->getSeoElementByMetaBundleType($metaBundleSourceType);
382 382
             $metaBundleSourceType = SeoEntry::getMetaBundleType();
@@ -387,14 +387,14 @@  discard block
 block discarded – undo
387 387
             $dependency = new TagDependency([
388 388
                 'tags' => [
389 389
                     MetaContainers::GLOBAL_METACONTAINER_CACHE_TAG,
390
-                    MetaContainers::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId,
391
-                    MetaContainers::METACONTAINER_CACHE_TAG . $uri . $siteId,
390
+                    MetaContainers::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId,
391
+                    MetaContainers::METACONTAINER_CACHE_TAG.$uri.$siteId,
392 392
                 ],
393 393
             ]);
394 394
             $cache = Craft::$app->getCache();
395 395
             $cacheDuration = null;
396 396
             $html = $cache->getOrSet(
397
-                self::CACHE_KEY . $cacheKey,
397
+                self::CACHE_KEY.$cacheKey,
398 398
                 function() use ($uri, $siteId, $element) {
399 399
                     Seomatic::$plugin->metaContainers->previewMetaContainers($uri, $siteId, true, true, $element);
400 400
                     $variables = [
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
         array   &$variables
437 437
     ) {
438 438
         $variables['textFieldSources'] = array_merge(
439
-            ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'],
439
+            ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'],
440 440
             FieldHelper::fieldsOfTypeFromElement(
441 441
                 $element,
442 442
                 FieldHelper::TEXT_FIELD_CLASS_KEY,
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
             )
445 445
         );
446 446
         $variables['assetFieldSources'] = array_merge(
447
-            ['entryGroup' => ['optgroup' => $groupName . ' Fields']],
447
+            ['entryGroup' => ['optgroup' => $groupName.' Fields']],
448 448
             FieldHelper::fieldsOfTypeFromElement(
449 449
                 $element,
450 450
                 FieldHelper::ASSET_FIELD_CLASS_KEY,
Please login to merge, or discard this patch.
src/helpers/Sitemap.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         if ($multiSite) {
121 121
             $urlsetLine .= ' xmlns:xhtml="http://www.w3.org/1999/xhtml"';
122 122
         }
123
-        if ((bool)$metaBundle->metaSitemapVars->newsSitemap) {
123
+        if ((bool) $metaBundle->metaSitemapVars->newsSitemap) {
124 124
             $urlsetLine .= ' xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"';
125 125
         }
126 126
         $urlsetLine .= '>';
@@ -188,13 +188,13 @@  discard block
 block discarded – undo
188 188
                         $paginator->getTotalPages(),
189 189
                         $paginator->getTotalResults());
190 190
                 }
191
-                echo $message . PHP_EOL;
191
+                echo $message.PHP_EOL;
192 192
             }
193 193
             /** @var Element $element */
194 194
             foreach ($elements as $element) {
195 195
                 // Output some info if this is a console app
196 196
                 if (Craft::$app instanceof ConsoleApplication) {
197
-                    echo "Processing element {$currentElement}/{$totalElements} - {$element->title}" . PHP_EOL;
197
+                    echo "Processing element {$currentElement}/{$totalElements} - {$element->title}".PHP_EOL;
198 198
                 }
199 199
 
200 200
                 $metaBundle->metaSitemapVars->setAttributes($stashedSitemapAttrs, false);
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
                         }
243 243
                         $canonicalUrl = UrlHelper::absoluteUrlWithProtocol($canonicalUrl);
244 244
                         if ($url !== $canonicalUrl) {
245
-                            Craft::info("Excluding URL: {$url} from the sitemap because it does not match the Canonical URL: {$canonicalUrl} - " . $metaBundle->metaGlobalVars->canonicalUrl . " - " . $element->uri);
245
+                            Craft::info("Excluding URL: {$url} from the sitemap because it does not match the Canonical URL: {$canonicalUrl} - ".$metaBundle->metaGlobalVars->canonicalUrl." - ".$element->uri);
246 246
                             continue;
247 247
                         }
248 248
                     }
@@ -303,12 +303,12 @@  discard block
 block discarded – undo
303 303
                                             if ($primarySiteId === $altSourceSiteId && Seomatic::$settings->addXDefaultHrefLang) {
304 304
                                                 $lines[] = '<xhtml:link rel="alternate"'
305 305
                                                     . ' hreflang="x-default"'
306
-                                                    . ' href="' . Html::encode($altUrl) . '"'
306
+                                                    . ' href="'.Html::encode($altUrl).'"'
307 307
                                                     . ' />';
308 308
                                             }
309 309
                                             $lines[] = '<xhtml:link rel="alternate"'
310
-                                                . ' hreflang="' . $altSiteSettings['language'] . '"'
311
-                                                . ' href="' . Html::encode($altUrl) . '"'
310
+                                                . ' hreflang="'.$altSiteSettings['language'].'"'
311
+                                                . ' href="'.Html::encode($altUrl).'"'
312 312
                                                 . ' />';
313 313
                                         }
314 314
                                     }
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
                         }
318 318
                     }
319 319
                     // Handle news sitemaps https://developers.google.com/search/docs/crawling-indexing/sitemaps/news-sitemap
320
-                    if ((bool)$metaBundle->metaSitemapVars->newsSitemap) {
320
+                    if ((bool) $metaBundle->metaSitemapVars->newsSitemap) {
321 321
                         $now = new DateTime();
322 322
                         $interval = $now->diff($dateUpdated);
323 323
                         if ($interval->days <= 2) {
@@ -327,11 +327,11 @@  discard block
 block discarded – undo
327 327
                             }
328 328
                             $lines[] = '<news:news>';
329 329
                             $lines[] = '<news:publication>';
330
-                            $lines[] = '<news:name>' . $metaBundle->metaSitemapVars->newsPublicationName . '</news:name>';
331
-                            $lines[] = '<news:language>' . $language . '</news:language>';
330
+                            $lines[] = '<news:name>'.$metaBundle->metaSitemapVars->newsPublicationName.'</news:name>';
331
+                            $lines[] = '<news:language>'.$language.'</news:language>';
332 332
                             $lines[] = '</news:publication>';
333
-                            $lines[] = '<news:publication_date>' . $dateUpdated->format(DateTime::W3C) . '</news:publication_date>';
334
-                            $lines[] = '<news:title>' . $element->title . '</news:title>';
333
+                            $lines[] = '<news:publication_date>'.$dateUpdated->format(DateTime::W3C).'</news:publication_date>';
334
+                            $lines[] = '<news:title>'.$element->title.'</news:title>';
335 335
                             $lines[] = '</news:news>';
336 336
                         }
337 337
                     }
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
      */
548 548
     protected static function assetSitemapItem(Asset $asset, MetaBundle $metaBundle, array &$lines)
549 549
     {
550
-        if ((bool)$asset->enabledForSite && $asset->getUrl() !== null) {
550
+        if ((bool) $asset->enabledForSite && $asset->getUrl() !== null) {
551 551
             switch ($asset->kind) {
552 552
                 case 'image':
553 553
                     $transform = Craft::$app->getAssetTransforms()->getTransformByHandle($metaBundle->metaSitemapVars->sitemapAssetTransform ?? '');
@@ -560,9 +560,9 @@  discard block
 block discarded – undo
560 560
                         $fieldName = $row['field'] ?? '';
561 561
                         $propName = $row['property'] ?? '';
562 562
                         if (!empty($fieldName) && !empty($asset[$fieldName]) && !empty($propName)) {
563
-                            $lines[] = '<image:' . $propName . '>';
563
+                            $lines[] = '<image:'.$propName.'>';
564 564
                             $lines[] = Html::encode($asset[$fieldName]);
565
-                            $lines[] = '</image:' . $propName . '>';
565
+                            $lines[] = '</image:'.$propName.'>';
566 566
                         }
567 567
                     }
568 568
                     $lines[] = '</image:image>';
@@ -578,9 +578,9 @@  discard block
 block discarded – undo
578 578
                         $fieldName = $row['field'] ?? '';
579 579
                         $propName = $row['property'] ?? '';
580 580
                         if (!empty($fieldName) && !empty($asset[$fieldName]) && !empty($propName)) {
581
-                            $lines[] = '<video:' . $propName . '>';
581
+                            $lines[] = '<video:'.$propName.'>';
582 582
                             $lines[] = Html::encode($asset[$fieldName]);
583
-                            $lines[] = '</video:' . $propName . '>';
583
+                            $lines[] = '</video:'.$propName.'>';
584 584
                         }
585 585
                     }
586 586
                     $lines[] = '</video:video>';
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
      */
597 597
     protected static function assetFilesSitemapLink(Asset $asset, MetaBundle $metaBundle, array &$lines)
598 598
     {
599
-        if ((bool)$asset->enabledForSite && $asset->getUrl() !== null) {
599
+        if ((bool) $asset->enabledForSite && $asset->getUrl() !== null) {
600 600
             if (in_array($asset->kind, SitemapTemplate::FILE_TYPES, false)) {
601 601
                 $dateUpdated = $asset->dateUpdated ?? $asset->dateCreated ?? new DateTime();
602 602
                 $lines[] = '<url>';
Please login to merge, or discard this patch.
src/services/Sitemaps.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
     // Constants
44 44
     // =========================================================================
45 45
 
46
-    const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapIndexTemplate::TEMPLATE_TYPE;
46
+    const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapIndexTemplate::TEMPLATE_TYPE;
47 47
 
48
-    const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapTemplate::TEMPLATE_TYPE;
48
+    const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapTemplate::TEMPLATE_TYPE;
49 49
 
50
-    const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapCustomTemplate::TEMPLATE_TYPE;
50
+    const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapCustomTemplate::TEMPLATE_TYPE;
51 51
 
52 52
     const SEARCH_ENGINE_SUBMISSION_URLS = [
53 53
     ];
@@ -247,19 +247,19 @@  discard block
 block discarded – undo
247 247
                         $siteId = $groupSiteIds[0];
248 248
                         $sitemapIndexUrl = $this->sitemapIndexUrlForSiteId($siteId);
249 249
                         if (!empty($sitemapIndexUrl)) {
250
-                            $submissionUrl = $url . urlencode($sitemapIndexUrl);
250
+                            $submissionUrl = $url.urlencode($sitemapIndexUrl);
251 251
                             // create new guzzle client
252 252
                             $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]);
253 253
                             // Submit the sitemap index to each search engine
254 254
                             try {
255 255
                                 $guzzleClient->post($submissionUrl);
256 256
                                 Craft::info(
257
-                                    'Sitemap index submitted to: ' . $submissionUrl,
257
+                                    'Sitemap index submitted to: '.$submissionUrl,
258 258
                                     __METHOD__
259 259
                                 );
260 260
                             } catch (\Exception $e) {
261 261
                                 Craft::error(
262
-                                    'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(),
262
+                                    'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(),
263 263
                                     __METHOD__
264 264
                                 );
265 265
                             }
@@ -321,19 +321,19 @@  discard block
 block discarded – undo
321 321
             foreach ($searchEngineUrls as &$url) {
322 322
                 $sitemapUrl = $this->sitemapUrlForBundle($sourceBundleType, $sourceHandle, $sourceSiteId);
323 323
                 if (!empty($sitemapUrl)) {
324
-                    $submissionUrl = $url . urlencode($sitemapUrl);
324
+                    $submissionUrl = $url.urlencode($sitemapUrl);
325 325
                     // create new guzzle client
326 326
                     $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]);
327 327
                     // Submit the sitemap index to each search engine
328 328
                     try {
329 329
                         $guzzleClient->post($submissionUrl);
330 330
                         Craft::info(
331
-                            'Sitemap index submitted to: ' . $submissionUrl,
331
+                            'Sitemap index submitted to: '.$submissionUrl,
332 332
                             __METHOD__
333 333
                         );
334 334
                     } catch (\Exception $e) {
335 335
                         Craft::error(
336
-                            'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(),
336
+                            'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(),
337 337
                             __METHOD__
338 338
                         );
339 339
                     }
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
                     . '-'
375 375
                     . $metaBundle->sourceSiteId
376 376
                     . '-sitemap'
377
-                    . (!empty($page) ? '-p' . $page : '')
377
+                    . (!empty($page) ? '-p'.$page : '')
378 378
                     . '.xml',
379 379
                     null,
380 380
                     null,
@@ -403,19 +403,19 @@  discard block
 block discarded – undo
403 403
             foreach ($searchEngineUrls as &$url) {
404 404
                 $sitemapUrl = $this->sitemapCustomUrlForSiteId($siteId);
405 405
                 if (!empty($sitemapUrl)) {
406
-                    $submissionUrl = $url . urlencode($sitemapUrl);
406
+                    $submissionUrl = $url.urlencode($sitemapUrl);
407 407
                     // create new guzzle client
408 408
                     $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]);
409 409
                     // Submit the sitemap index to each search engine
410 410
                     try {
411 411
                         $guzzleClient->post($submissionUrl);
412 412
                         Craft::info(
413
-                            'Sitemap Custom submitted to: ' . $submissionUrl,
413
+                            'Sitemap Custom submitted to: '.$submissionUrl,
414 414
                             __METHOD__
415 415
                         );
416 416
                     } catch (\Exception $e) {
417 417
                         Craft::error(
418
-                            'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(),
418
+                            'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(),
419 419
                             __METHOD__
420 420
                         );
421 421
                     }
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
         }
494 494
 
495 495
         foreach ($sites as $site) {
496
-            $result .= 'sitemap: ' . $this->sitemapIndexUrlForSiteId($site->id) . PHP_EOL;
496
+            $result .= 'sitemap: '.$this->sitemapIndexUrlForSiteId($site->id).PHP_EOL;
497 497
         }
498 498
 
499 499
         return rtrim($result, PHP_EOL);
@@ -524,9 +524,9 @@  discard block
 block discarded – undo
524 524
     {
525 525
         // Always just invalidate the sitemap cache now, since we're doing paginated sitemaps
526 526
         $cache = Craft::$app->getCache();
527
-        TagDependency::invalidate($cache, SitemapTemplate::SITEMAP_CACHE_TAG . $handle . $siteId);
527
+        TagDependency::invalidate($cache, SitemapTemplate::SITEMAP_CACHE_TAG.$handle.$siteId);
528 528
         Craft::info(
529
-            'Sitemap cache cleared: ' . $handle,
529
+            'Sitemap cache cleared: '.$handle,
530 530
             __METHOD__
531 531
         );
532 532
     }
Please login to merge, or discard this patch.
src/services/MetaContainers.php 1 patch
Spacing   +16 added lines, -16 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,21 +405,21 @@  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,
420
+                    self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId,
421
+                    self::METACONTAINER_CACHE_TAG.$uri.$siteId,
422
+                    self::METACONTAINER_CACHE_TAG.$cacheKey,
423 423
                 ],
424 424
             ]);
425 425
             $this->containerDependency = $dependency;
@@ -436,10 +436,10 @@  discard block
 block discarded – undo
436 436
             } else {
437 437
                 $cache = Craft::$app->getCache();
438 438
                 list($this->metaGlobalVars, $this->metaSiteVars, $this->metaSitemapVars, $this->metaContainers) = $cache->getOrSet(
439
-                    self::CACHE_KEY . $cacheKey,
439
+                    self::CACHE_KEY.$cacheKey,
440 440
                     function() use ($uri, $siteId) {
441 441
                         Craft::info(
442
-                            'Meta container cache miss: ' . $uri . '/' . $siteId,
442
+                            'Meta container cache miss: '.$uri.'/'.$siteId,
443 443
                             __METHOD__
444 444
                         );
445 445
                         $this->loadGlobalMetaContainers($siteId);
@@ -843,10 +843,10 @@  discard block
 block discarded – undo
843 843
         $cache = Craft::$app->getCache();
844 844
         TagDependency::invalidate(
845 845
             $cache,
846
-            self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId
846
+            self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId
847 847
         );
848 848
         Craft::info(
849
-            'Meta bundle cache cleared: ' . $metaBundleSourceId . ' / ' . $metaBundleSourceType . ' / ' . $siteId,
849
+            'Meta bundle cache cleared: '.$metaBundleSourceId.' / '.$metaBundleSourceType.' / '.$siteId,
850 850
             __METHOD__
851 851
         );
852 852
         // Trigger an event to let other plugins/modules know we've cleared our caches
@@ -873,9 +873,9 @@  discard block
 block discarded – undo
873 873
         if ($siteId === null) {
874 874
             $siteId = Craft::$app->getSites()->currentSite->id ?? 1;
875 875
         }
876
-        TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG . $uri . $siteId);
876
+        TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG.$uri.$siteId);
877 877
         Craft::info(
878
-            'Meta container cache cleared: ' . $uri . ' / ' . $siteId,
878
+            'Meta container cache cleared: '.$uri.' / '.$siteId,
879 879
             __METHOD__
880 880
         );
881 881
         // Trigger an event to let other plugins/modules know we've cleared our caches
@@ -1018,7 +1018,7 @@  discard block
 block discarded – undo
1018 1018
 
1019 1019
                     // Handle re-creating the `mainEntityOfPage` so that the model injected into the
1020 1020
                     // templates has the appropriate attributes
1021
-                    $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE . JsonLdService::GENERAL_HANDLE;
1021
+                    $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE.JsonLdService::GENERAL_HANDLE;
1022 1022
                     $generalContainer = $this->metaContainers[$generalContainerKey];
1023 1023
                     if (($generalContainer !== null) && !empty($generalContainer->data['mainEntityOfPage'])) {
1024 1024
                         /** @var MetaJsonLd $jsonLdModel */
Please login to merge, or discard this patch.
src/helpers/Container.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -90,24 +90,24 @@
 block discarded – undo
90 90
         }
91 91
         // Get our cache key
92 92
         $asArrayKey = $asArray ? 'true' : 'false';
93
-        $cacheKey = $uri . $siteId . implode($containerKeys) . $asArrayKey . Seomatic::$environment . $token;
93
+        $cacheKey = $uri.$siteId.implode($containerKeys).$asArrayKey.Seomatic::$environment.$token;
94 94
         // Load the meta containers
95 95
         $dependency = new TagDependency([
96 96
             'tags' => [
97 97
                 $metaContainers::GLOBAL_METACONTAINER_CACHE_TAG,
98
-                $metaContainers::METACONTAINER_CACHE_TAG . $sourceId . $sourceBundleType . $siteId,
99
-                $metaContainers::METACONTAINER_CACHE_TAG . $uri . $siteId,
100
-                $metaContainers::METACONTAINER_CACHE_TAG . $cacheKey,
98
+                $metaContainers::METACONTAINER_CACHE_TAG.$sourceId.$sourceBundleType.$siteId,
99
+                $metaContainers::METACONTAINER_CACHE_TAG.$uri.$siteId,
100
+                $metaContainers::METACONTAINER_CACHE_TAG.$cacheKey,
101 101
             ],
102 102
         ]);
103 103
 
104 104
         $cache = Craft::$app->getCache();
105 105
         $result = $cache->getOrSet(
106
-            self::CACHE_KEY . $cacheKey,
106
+            self::CACHE_KEY.$cacheKey,
107 107
             function() use ($uri, $siteId, $containerKeys, $asArray) {
108 108
                 $result = [];
109 109
                 Craft::info(
110
-                    'Meta controller container cache miss: ' . $uri . '/' . $siteId,
110
+                    'Meta controller container cache miss: '.$uri.'/'.$siteId,
111 111
                     __METHOD__
112 112
                 );
113 113
                 // Load the meta containers and parse our globals
Please login to merge, or discard this patch.
src/models/SitemapTemplate.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
         }
141 141
 
142 142
         $cache = Craft::$app->getCache();
143
-        $pageCacheSuffix = 's' . (int)$metaBundle->metaSitemapVars->sitemapPageSize . 'p' . $page;
143
+        $pageCacheSuffix = 's'.(int) $metaBundle->metaSitemapVars->sitemapPageSize.'p'.$page;
144 144
 
145
-        $uniqueKey = $groupId . $type . $handle . $siteId . $pageCacheSuffix;
146
-        $cacheKey = self::CACHE_KEY . $uniqueKey;
145
+        $uniqueKey = $groupId.$type.$handle.$siteId.$pageCacheSuffix;
146
+        $cacheKey = self::CACHE_KEY.$uniqueKey;
147 147
         $result = $cache->get($cacheKey);
148 148
 
149 149
         // If the sitemap isn't cached, render it immediately
@@ -160,8 +160,8 @@  discard block
 block discarded – undo
160 160
                 $dependency = new TagDependency([
161 161
                     'tags' => [
162 162
                         self::GLOBAL_SITEMAP_CACHE_TAG,
163
-                        self::SITEMAP_CACHE_TAG . $handle . $siteId,
164
-                        self::SITEMAP_CACHE_TAG . $handle . $siteId . $pageCacheSuffix,
163
+                        self::SITEMAP_CACHE_TAG.$handle.$siteId,
164
+                        self::SITEMAP_CACHE_TAG.$handle.$siteId.$pageCacheSuffix,
165 165
                     ],
166 166
                 ]);
167 167
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 
174 174
                 // Output some info if this is a console app
175 175
                 if (Craft::$app instanceof ConsoleApplication) {
176
-                    echo 'Sitemap cache result: ' . print_r($result, true) . ' for cache key: ' . $cacheKey . PHP_EOL;
176
+                    echo 'Sitemap cache result: '.print_r($result, true).' for cache key: '.$cacheKey.PHP_EOL;
177 177
                 }
178 178
 
179 179
                 // If the FastCGI Cache Bust plugin is installed, clear its caches too
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
             }
188 188
         } else {
189 189
             if (Craft::$app instanceof ConsoleApplication) {
190
-                echo 'Found in cache' . PHP_EOL;
190
+                echo 'Found in cache'.PHP_EOL;
191 191
             }
192 192
         }
193 193
 
@@ -203,9 +203,9 @@  discard block
 block discarded – undo
203 203
     public function invalidateCache(string $handle, int $siteId)
204 204
     {
205 205
         $cache = Craft::$app->getCache();
206
-        TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG . $handle . $siteId);
206
+        TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG.$handle.$siteId);
207 207
         Craft::info(
208
-            'Sitemap cache cleared: ' . $handle,
208
+            'Sitemap cache cleared: '.$handle,
209 209
             __METHOD__
210 210
         );
211 211
     }
Please login to merge, or discard this patch.
src/controllers/SettingsController.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -509,8 +509,8 @@  discard block
 block discarded – undo
509 509
         string $sourceBundleType,
510 510
         string $sourceHandle,
511 511
         string $siteHandle = null,
512
-               $typeId = null,
513
-               $loadFromSiteHandle = null
512
+                $typeId = null,
513
+                $loadFromSiteHandle = null
514 514
     ): Response {
515 515
         $variables = [];
516 516
         // @TODO: Let people choose an entry/categorygroup/product as the preview
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
         string $sourceHandle,
1227 1227
         string $groupName,
1228 1228
         array  &$variables,
1229
-               $typeId = null
1229
+                $typeId = null
1230 1230
     ) {
1231 1231
         $variables['textFieldSources'] = array_merge(
1232 1232
             ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'],
Please login to merge, or discard this patch.
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         $variables['pluginName'] = Seomatic::$settings->pluginName;
132 132
         $variables['title'] = $templateTitle;
133 133
         $variables['docTitle'] = "{$pluginName} - {$templateTitle}";
134
-        $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : '';
134
+        $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : '';
135 135
         $variables['crumbs'] = [
136 136
             [
137 137
                 'label' => $pluginName,
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
             ],
140 140
             [
141 141
                 'label' => $templateTitle,
142
-                'url' => UrlHelper::cpUrl('seomatic/dashboard' . $siteHandleUri),
142
+                'url' => UrlHelper::cpUrl('seomatic/dashboard'.$siteHandleUri),
143 143
             ],
144 144
         ];
145 145
         $variables['selectedSubnavItem'] = 'dashboard';
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
         foreach ($variables['metaBundles'] as $metaBundle) {
163 163
             $stat = 0;
164 164
             foreach (self::SEO_SETUP_FIELDS as $setupField => $setupLabel) {
165
-                $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]);
165
+                $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]);
166 166
                 $value = $variables['contentSetupChecklist'][$setupField]['value'] ?? 0;
167 167
                 $variables['contentSetupChecklist'][$setupField] = [
168 168
                     'label' => $setupLabel,
169
-                    'value' => $value + (int)!empty($metaBundle->metaGlobalVars[$setupField]),
169
+                    'value' => $value + (int) !empty($metaBundle->metaGlobalVars[$setupField]),
170 170
                 ];
171 171
             }
172 172
             $stat = round($numGrades - (($stat * $numGrades) / $numFields));
@@ -177,16 +177,16 @@  discard block
 block discarded – undo
177 177
         }
178 178
         // Global SEO grades
179 179
         Seomatic::$previewingMetaContainers = true;
180
-        $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int)$siteId);
180
+        $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int) $siteId);
181 181
         Seomatic::$previewingMetaContainers = false;
182 182
         if ($metaBundle !== null) {
183 183
             $stat = 0;
184 184
             $variables['globalSetupChecklist'] = [];
185 185
             foreach (self::SEO_SETUP_FIELDS as $setupField => $setupLabel) {
186
-                $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]);
186
+                $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]);
187 187
                 $variables['globalSetupChecklist'][$setupField] = [
188 188
                     'label' => $setupLabel,
189
-                    'value' => (int)!empty($metaBundle->metaGlobalVars[$setupField]),
189
+                    'value' => (int) !empty($metaBundle->metaGlobalVars[$setupField]),
190 190
                 ];
191 191
             }
192 192
             $stat = round(($stat / $numFields) * 100);
@@ -196,17 +196,17 @@  discard block
 block discarded – undo
196 196
             $stat = 0;
197 197
             $variables['siteSetupChecklist'] = [];
198 198
             foreach (self::SITE_SETUP_FIELDS as $setupField => $setupLabel) {
199
-                $stat += (int)!empty($metaBundle->metaSiteVars[$setupField]);
199
+                $stat += (int) !empty($metaBundle->metaSiteVars[$setupField]);
200 200
                 $variables['siteSetupChecklist'][$setupField] = [
201 201
                     'label' => $setupLabel,
202
-                    'value' => (int)!empty($metaBundle->metaSiteVars[$setupField]),
202
+                    'value' => (int) !empty($metaBundle->metaSiteVars[$setupField]),
203 203
                 ];
204 204
             }
205 205
             foreach (self::IDENTITY_SETUP_FIELDS as $setupField => $setupLabel) {
206
-                $stat += (int)!empty($metaBundle->metaSiteVars->identity[$setupField]);
206
+                $stat += (int) !empty($metaBundle->metaSiteVars->identity[$setupField]);
207 207
                 $variables['siteSetupChecklist'][$setupField] = [
208 208
                     'label' => $setupLabel,
209
-                    'value' => (int)!empty($metaBundle->metaSiteVars->identity[$setupField]),
209
+                    'value' => (int) !empty($metaBundle->metaSiteVars->identity[$setupField]),
210 210
                 ];
211 211
             }
212 212
             $stat = round(($stat / $numFields) * 100);
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
         $variables['title'] = $templateTitle;
254 254
         $variables['subSectionTitle'] = $subSectionTitle;
255 255
         $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}";
256
-        $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : '';
256
+        $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : '';
257 257
         $variables['crumbs'] = [
258 258
             [
259 259
                 'label' => $pluginName,
@@ -261,11 +261,11 @@  discard block
 block discarded – undo
261 261
             ],
262 262
             [
263 263
                 'label' => $templateTitle,
264
-                'url' => UrlHelper::cpUrl('seomatic/global/general' . $siteHandleUri),
264
+                'url' => UrlHelper::cpUrl('seomatic/global/general'.$siteHandleUri),
265 265
             ],
266 266
             [
267 267
                 'label' => $subSectionTitle,
268
-                'url' => UrlHelper::cpUrl('seomatic/global/' . $subSection . $siteHandleUri),
268
+                'url' => UrlHelper::cpUrl('seomatic/global/'.$subSection.$siteHandleUri),
269 269
             ],
270 270
         ];
271 271
         $variables['selectedSubnavItem'] = 'global';
@@ -273,14 +273,14 @@  discard block
 block discarded – undo
273 273
         $this->setGlobalFieldSourceVariables($variables);
274 274
         // Enabled sites
275 275
         $this->setMultiSiteVariables($siteHandle, $siteId, $variables);
276
-        $variables['controllerHandle'] = 'global' . '/' . $subSection;
276
+        $variables['controllerHandle'] = 'global'.'/'.$subSection;
277 277
         $variables['currentSubSection'] = $subSection;
278 278
         // Meta bundle settings
279 279
         Seomatic::$previewingMetaContainers = true;
280 280
         // Get the site to copy the settings from, if any
281 281
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
282 282
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
283
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
283
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
284 284
         // Load the metabundle
285 285
         $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad);
286 286
         if ($editedMetaBundle) {
@@ -334,11 +334,11 @@  discard block
 block discarded – undo
334 334
         // Preview the meta containers
335 335
         Seomatic::$plugin->metaContainers->previewMetaContainers(
336 336
             MetaBundles::GLOBAL_META_BUNDLE,
337
-            (int)$variables['currentSiteId']
337
+            (int) $variables['currentSiteId']
338 338
         );
339 339
 
340 340
         // Render the template
341
-        return $this->renderTemplate('seomatic/settings/global/' . $subSection, $variables);
341
+        return $this->renderTemplate('seomatic/settings/global/'.$subSection, $variables);
342 342
     }
343 343
 
344 344
     /**
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
         $variables['pluginName'] = Seomatic::$settings->pluginName;
470 470
         $variables['title'] = $templateTitle;
471 471
         $variables['docTitle'] = "{$pluginName} - {$templateTitle}";
472
-        $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : '';
472
+        $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : '';
473 473
         $variables['crumbs'] = [
474 474
             [
475 475
                 'label' => $pluginName,
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
             ],
478 478
             [
479 479
                 'label' => $templateTitle,
480
-                'url' => UrlHelper::cpUrl('seomatic/content' . $siteHandleUri),
480
+                'url' => UrlHelper::cpUrl('seomatic/content'.$siteHandleUri),
481 481
             ],
482 482
         ];
483 483
         $this->setMultiSiteVariables($siteHandle, $siteId, $variables);
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
         // Get the site to edit
518 518
         $siteId = $this->getSiteIdFromHandle($siteHandle);
519 519
         if (is_string($typeId)) {
520
-            $typeId = (int)$typeId;
520
+            $typeId = (int) $typeId;
521 521
         }
522 522
         // Get the (entry) type menu
523 523
         $typeMenu = [];
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
             $currentType = reset($typeMenu);
532 532
             $variables['currentType'] = $typeMenu[$typeId] ?? $currentType;
533 533
             $variables['currentTypeId'] = $typeId ?? key($typeMenu);
534
-            $typeId = (int)$variables['currentTypeId'];
534
+            $typeId = (int) $variables['currentTypeId'];
535 535
         }
536 536
         $pluginName = Seomatic::$settings->pluginName;
537 537
         // Asset bundle
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
         // Get the site to copy the settings from, if any
553 553
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
554 554
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
555
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
555
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
556 556
         // Load the metabundle
557 557
         $metaBundle = Seomatic::$plugin->metaBundles->getMetaBundleBySourceHandle(
558 558
             $sourceBundleType,
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
         $variables['title'] = $templateTitle;
579 579
         $variables['subSectionTitle'] = $subSectionTitle;
580 580
         $variables['docTitle'] = "{$pluginName} - Content SEO - {$templateTitle} - {$subSectionTitle}";
581
-        $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : '';
581
+        $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : '';
582 582
         $variables['siteHandleUri'] = $siteHandleUri;
583 583
         $variables['crumbs'] = [
584 584
             [
@@ -587,10 +587,10 @@  discard block
 block discarded – undo
587 587
             ],
588 588
             [
589 589
                 'label' => 'Content SEO',
590
-                'url' => UrlHelper::cpUrl('seomatic/content' . $siteHandleUri),
590
+                'url' => UrlHelper::cpUrl('seomatic/content'.$siteHandleUri),
591 591
             ],
592 592
             [
593
-                'label' => $metaBundle->sourceName . ' · ' . $subSectionTitle,
593
+                'label' => $metaBundle->sourceName.' · '.$subSectionTitle,
594 594
                 'url' => UrlHelper::cpUrl("seomatic/edit-content/${subSection}/${sourceBundleType}/${sourceHandle}"),
595 595
             ],
596 596
         ];
@@ -620,13 +620,13 @@  discard block
 block discarded – undo
620 620
         // Preview the meta containers
621 621
         Seomatic::$plugin->metaContainers->previewMetaContainers(
622 622
             $uri,
623
-            (int)$variables['currentSiteId'],
623
+            (int) $variables['currentSiteId'],
624 624
             false,
625 625
             false
626 626
         );
627 627
 
628 628
         // Render the template
629
-        return $this->renderTemplate('seomatic/settings/content/' . $subSection, $variables);
629
+        return $this->renderTemplate('seomatic/settings/content/'.$subSection, $variables);
630 630
     }
631 631
 
632 632
     /**
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
         $bundleSettings = $request->getParam('metaBundleSettings');
647 647
         $sitemapSettings = $request->getParam('metaSitemapVars');
648 648
         if (is_string($typeId)) {
649
-            $typeId = (int)$typeId;
649
+            $typeId = (int) $typeId;
650 650
         }
651 651
         // Set the element type in the template
652 652
         $elementName = '';
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
         if ($subSection === 'social') {
712 712
             $subSectionSuffix = ' Media';
713 713
         }
714
-        $subSectionTitle = Craft::t('seomatic', ucfirst($subSection) . $subSectionSuffix);
714
+        $subSectionTitle = Craft::t('seomatic', ucfirst($subSection).$subSectionSuffix);
715 715
         // Asset bundle
716 716
         try {
717 717
             Seomatic::$view->registerAssetBundle(SeomaticAsset::class);
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
         $variables['title'] = $templateTitle;
730 730
         $variables['subSectionTitle'] = $subSectionTitle;
731 731
         $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}";
732
-        $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : '';
732
+        $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : '';
733 733
         $variables['crumbs'] = [
734 734
             [
735 735
                 'label' => $pluginName,
@@ -737,11 +737,11 @@  discard block
 block discarded – undo
737 737
             ],
738 738
             [
739 739
                 'label' => $templateTitle,
740
-                'url' => UrlHelper::cpUrl('seomatic/site/identity' . $siteHandleUri),
740
+                'url' => UrlHelper::cpUrl('seomatic/site/identity'.$siteHandleUri),
741 741
             ],
742 742
             [
743 743
                 'label' => $subSectionTitle,
744
-                'url' => UrlHelper::cpUrl('seomatic/site/' . $subSection . $siteHandleUri),
744
+                'url' => UrlHelper::cpUrl('seomatic/site/'.$subSection.$siteHandleUri),
745 745
             ],
746 746
         ];
747 747
         $variables['selectedSubnavItem'] = 'site';
@@ -749,14 +749,14 @@  discard block
 block discarded – undo
749 749
 
750 750
         // Enabled sites
751 751
         $this->setMultiSiteVariables($siteHandle, $siteId, $variables);
752
-        $variables['controllerHandle'] = 'site' . '/' . $subSection;
752
+        $variables['controllerHandle'] = 'site'.'/'.$subSection;
753 753
 
754 754
         // The site settings for the appropriate meta bundle
755 755
         Seomatic::$previewingMetaContainers = true;
756 756
         // Get the site to copy the settings from, if any
757 757
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
758 758
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
759
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
759
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
760 760
         // Load the metabundle
761 761
         $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad);
762 762
         Seomatic::$previewingMetaContainers = false;
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
         $variables['elementType'] = Asset::class;
775 775
 
776 776
         // Render the template
777
-        return $this->renderTemplate('seomatic/settings/site/' . $subSection, $variables);
777
+        return $this->renderTemplate('seomatic/settings/site/'.$subSection, $variables);
778 778
     }
779 779
 
780 780
     /**
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
         $siteId = $this->getSiteIdFromHandle($siteHandle);
908 908
         // Enabled sites
909 909
         $this->setMultiSiteVariables($siteHandle, $siteId, $variables);
910
-        $variables['controllerHandle'] = 'tracking' . '/' . $subSection;
910
+        $variables['controllerHandle'] = 'tracking'.'/'.$subSection;
911 911
         $variables['currentSubSection'] = $subSection;
912 912
 
913 913
         // The script meta containers for the global meta bundle
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
         // Get the site to copy the settings from, if any
916 916
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
917 917
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
918
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
918
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
919 919
         // Load the metabundle
920 920
         $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad);
921 921
         if ($editedMetaBundle) {
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
         $variables['title'] = $templateTitle;
956 956
         $variables['subSectionTitle'] = $subSectionTitle;
957 957
         $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}";
958
-        $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : '';
958
+        $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : '';
959 959
         $variables['crumbs'] = [
960 960
             [
961 961
                 'label' => $pluginName,
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
             ],
968 968
             [
969 969
                 'label' => $subSectionTitle,
970
-                'url' => UrlHelper::cpUrl('seomatic/tracking/' . $subSection . $siteHandleUri),
970
+                'url' => UrlHelper::cpUrl('seomatic/tracking/'.$subSection.$siteHandleUri),
971 971
             ],
972 972
         ];
973 973
         $variables['selectedSubnavItem'] = 'tracking';
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
         if ($siteHandle !== null) {
1107 1107
             $site = Craft::$app->getSites()->getSiteByHandle($siteHandle);
1108 1108
             if (!$site) {
1109
-                throw new NotFoundHttpException('Invalid site handle: ' . $siteHandle);
1109
+                throw new NotFoundHttpException('Invalid site handle: '.$siteHandle);
1110 1110
             }
1111 1111
             $siteId = $site->id;
1112 1112
         } else {
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
                 if (!empty($variables['enabledSiteIds'])) {
1143 1143
                     $siteId = reset($variables['enabledSiteIds']);
1144 1144
                 } else {
1145
-                    $this->requirePermission('editSite:' . $siteId);
1145
+                    $this->requirePermission('editSite:'.$siteId);
1146 1146
                 }
1147 1147
             }
1148 1148
         }
@@ -1162,7 +1162,7 @@  discard block
 block discarded – undo
1162 1162
         if ($variables['showSites']) {
1163 1163
             $variables['sitesMenuLabel'] = Craft::t(
1164 1164
                 'site',
1165
-                $sites->getSiteById((int)$variables['currentSiteId'])->name
1165
+                $sites->getSiteById((int) $variables['currentSiteId'])->name
1166 1166
             );
1167 1167
         } else {
1168 1168
             $variables['sitesMenuLabel'] = '';
@@ -1229,7 +1229,7 @@  discard block
 block discarded – undo
1229 1229
                $typeId = null
1230 1230
     ) {
1231 1231
         $variables['textFieldSources'] = array_merge(
1232
-            ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'],
1232
+            ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'],
1233 1233
             FieldHelper::fieldsOfTypeFromSource(
1234 1234
                 $sourceBundleType,
1235 1235
                 $sourceHandle,
@@ -1239,7 +1239,7 @@  discard block
 block discarded – undo
1239 1239
             )
1240 1240
         );
1241 1241
         $variables['assetFieldSources'] = array_merge(
1242
-            ['entryGroup' => ['optgroup' => $groupName . ' Fields']],
1242
+            ['entryGroup' => ['optgroup' => $groupName.' Fields']],
1243 1243
             FieldHelper::fieldsOfTypeFromSource(
1244 1244
                 $sourceBundleType,
1245 1245
                 $sourceHandle,
Please login to merge, or discard this patch.
src/seoelements/SeoEntry.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
             ->limit($metaBundle->metaSitemapVars->sitemapLimit);
223 223
         if ($metaBundle->sourceType === 'structure'
224 224
             && !empty($metaBundle->metaSitemapVars->structureDepth)) {
225
-            $query->level($metaBundle->metaSitemapVars->structureDepth . '<=');
225
+            $query->level($metaBundle->metaSitemapVars->structureDepth.'<=');
226 226
         }
227 227
 
228 228
         return $query;
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
         if (!empty($typeId)) {
271 271
             $query
272 272
                 ->andWhere([
273
-                    'typeId' => (int)$typeId,
273
+                    'typeId' => (int) $typeId,
274 274
                 ]);
275 275
         }
276 276
         $element = $query->one();
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
             ConfigHelper::getConfigFromFile(self::configFilePath()),
398 398
             [
399 399
                 'sourceId' => $sourceModel->id,
400
-                'sourceName' => (string)$sourceModel->name,
400
+                'sourceName' => (string) $sourceModel->name,
401 401
                 'sourceHandle' => $sourceModel->handle,
402 402
                 'sourceType' => $sourceModel->type,
403 403
             ]
Please login to merge, or discard this patch.
src/services/MetaBundles.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
      * @param MetaBundle $metaBundle
195 195
      * @param bool $forceUpdate
196 196
      */
197
-    public function syncBundleWithConfig(MetaBundle &$metaBundle, bool $forceUpdate = false)
197
+    public function syncBundleWithConfig(MetaBundle & $metaBundle, bool $forceUpdate = false)
198 198
     {
199 199
         $prevMetaBundle = $metaBundle;
200 200
         $config = [];
@@ -275,8 +275,8 @@  discard block
 block discarded – undo
275 275
      */
276 276
     public function updateMetaBundle(MetaBundle $metaBundle, int $siteId)
277 277
     {
278
-        $metaBundle->sourceName = (string)$metaBundle->sourceName;
279
-        $metaBundle->sourceTemplate = (string)$metaBundle->sourceTemplate;
278
+        $metaBundle->sourceName = (string) $metaBundle->sourceName;
279
+        $metaBundle->sourceTemplate = (string) $metaBundle->sourceTemplate;
280 280
         // Make sure it validates
281 281
         if ($metaBundle->validate(null, true)) {
282 282
             // Save it out to a record
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
                 'sourceSiteId' => $siteId,
287 287
             ];
288 288
             if ($metaBundle->typeId !== null) {
289
-                $metaBundle->typeId = (int)$metaBundle->typeId;
289
+                $metaBundle->typeId = (int) $metaBundle->typeId;
290 290
             }
291 291
             if (!empty($metaBundle->typeId)) {
292 292
                 $params['typeId'] = $metaBundle->typeId;
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
             // The issue was that the containers were getting saved to the db with a hard-coded setting in them, because they'd
304 304
             // been set that way by the environment, whereas to be changeable via the GUI, it needs to be set to {seomatic.meta.robots}
305 305
             /** @var RobotsTag|null $robotsTag */
306
-            $robotsTag = $metaBundle->metaContainers[MetaTagContainer::CONTAINER_TYPE . TagService::GENERAL_HANDLE]->data['robots'] ?? null;
306
+            $robotsTag = $metaBundle->metaContainers[MetaTagContainer::CONTAINER_TYPE.TagService::GENERAL_HANDLE]->data['robots'] ?? null;
307 307
             if (!empty($robotsTag)) {
308 308
                 $robotsTag->content = $robotsTag->environment['live']['content'] ?? '{seomatic.meta.robots}';
309 309
             }
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
                     $metaBundleDefaults = ArrayHelper::merge(
385 385
                         $seoElement::metaBundleConfig($sourceModel),
386 386
                         [
387
-                            'sourceTemplate' => (string)$siteSetting->template,
387
+                            'sourceTemplate' => (string) $siteSetting->template,
388 388
                             'sourceSiteId' => $siteSetting->siteId,
389 389
                             'sourceAltSiteSettings' => $siteSettingsArray,
390 390
                             'sourceDateUpdated' => $dateUpdated,
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
     public function getMetaBundleBySourceHandle(string $sourceBundleType, string $sourceHandle, int $sourceSiteId, $typeId = null)
434 434
     {
435 435
         $metaBundle = null;
436
-        $typeId = (int)$typeId;
436
+        $typeId = (int) $typeId;
437 437
         // See if we have the meta bundle cached
438 438
         if (!empty($this->metaBundlesBySourceHandle[$sourceBundleType][$sourceHandle][$sourceSiteId][$typeId])) {
439 439
             $id = $this->metaBundlesBySourceHandle[$sourceBundleType][$sourceHandle][$sourceSiteId][$typeId];
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
                             /** @var Section|CategoryGroup|ProductType $sourceModel */
521 521
                             $sourceModel = $seoElement::sourceModelFromId($sourceId);
522 522
                             if ($sourceModel !== null) {
523
-                                $metaBundle->sourceName = (string)$sourceModel->name;
523
+                                $metaBundle->sourceName = (string) $sourceModel->name;
524 524
                                 $metaBundle->sourceHandle = $sourceModel->handle;
525 525
                             }
526 526
                         }
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
     public function getMetaBundleBySourceId(string $sourceBundleType, int $sourceId, ?int $sourceSiteId, $typeId = null)
562 562
     {
563 563
         $metaBundle = null;
564
-        $typeId = (int)$typeId;
564
+        $typeId = (int) $typeId;
565 565
         // See if we have the meta bundle cached
566 566
         if (!empty($this->metaBundlesBySourceId[$sourceBundleType][$sourceId][$sourceSiteId][$typeId])) {
567 567
             $id = $this->metaBundlesBySourceId[$sourceBundleType][$sourceId][$sourceSiteId][$typeId];
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
                 ->from(['{{%seomatic_metabundles}}'])
756 756
                 ->where(['=', 'sourceBundleType', $seoElement::META_BUNDLE_TYPE]);
757 757
 
758
-            if ((int)$sourceSiteId !== 0) {
758
+            if ((int) $sourceSiteId !== 0) {
759 759
                 $subQuery->andWhere(['sourceSiteId' => $sourceSiteId]);
760 760
             }
761 761
             if ($filter !== '') {
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
     public function getContentMetaBundleForElement(Element $element)
793 793
     {
794 794
         $source = $this->getMetaSourceFromElement($element);
795
-        $key = implode(".", $source) . '.' . $element->siteId;
795
+        $key = implode(".", $source).'.'.$element->siteId;
796 796
 
797 797
         if (empty($this->elementContentMetaBundles[$key])) {
798 798
             $this->elementContentMetaBundles[$key] = $this->getMetaBundleBySourceId($source[1], $source[0], $element->siteId, $source[4]);
Please login to merge, or discard this patch.