@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if (!empty($string)) { |
72 | 72 | $string = HtmlPurifier::process($string, ['HTML.Allowed' => '']); |
73 | 73 | $string = html_entity_decode($string, ENT_NOQUOTES, 'UTF-8'); |
74 | - $result = (string)Stringy::create($string)->truncate($length, $substring); |
|
74 | + $result = (string) Stringy::create($string)->truncate($length, $substring); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | return $result; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | if (!empty($string)) { |
97 | 97 | $string = HtmlPurifier::process($string, ['HTML.Allowed' => '']); |
98 | 98 | $string = html_entity_decode($string, ENT_NOQUOTES, 'UTF-8'); |
99 | - $result = (string)Stringy::create($string)->safeTruncate($length, $substring); |
|
99 | + $result = (string) Stringy::create($string)->safeTruncate($length, $substring); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | return $result; |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | $result = self::smartStripTags(Doxter::$plugin->getService()->parseMarkdown($field->getRaw())); |
128 | 128 | } else { |
129 | 129 | if (self::isArrayLike($field)) { |
130 | - $result = self::smartStripTags((string)$field[0]); |
|
130 | + $result = self::smartStripTags((string) $field[0]); |
|
131 | 131 | } else { |
132 | - $result = self::smartStripTags((string)$field); |
|
132 | + $result = self::smartStripTags((string) $field); |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $tags = $tags->all(); |
157 | 157 | } |
158 | 158 | foreach ($tags as $tag) { |
159 | - $result .= $tag->title . ', '; |
|
159 | + $result .= $tag->title.', '; |
|
160 | 160 | } |
161 | 161 | $result = rtrim($result, ', '); |
162 | 162 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | foreach ($fieldClasses as $fieldClassKey) { |
199 | 199 | if ($field instanceof $fieldClassKey) { |
200 | 200 | if ($field->handle === $fieldHandle || empty($fieldHandle)) { |
201 | - $result .= self::extractTextFromField($block[$field->handle]) . ' '; |
|
201 | + $result .= self::extractTextFromField($block[$field->handle]).' '; |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | } |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | foreach ($fieldClasses as $fieldClassKey) { |
241 | 241 | if ($field instanceof $fieldClassKey) { |
242 | 242 | if ($field->handle === $fieldHandle || empty($fieldHandle)) { |
243 | - $result .= self::extractTextFromField($block[$field->handle]) . ' '; |
|
243 | + $result .= self::extractTextFromField($block[$field->handle]).' '; |
|
244 | 244 | } |
245 | 245 | } |
246 | 246 | } |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | $str = html_entity_decode($str, ENT_NOQUOTES, 'UTF-8'); |
340 | 340 | $str = rawurldecode($str); |
341 | 341 | // Remove any linebreaks |
342 | - $str = (string)preg_replace("/\r|\n/", "", $str); |
|
342 | + $str = (string) preg_replace("/\r|\n/", "", $str); |
|
343 | 343 | $str = HtmlPurifier::process($str, ['HTML.Allowed' => '']); |
344 | 344 | $str = html_entity_decode($str, ENT_NOQUOTES, 'UTF-8'); |
345 | 345 | // Remove any embedded Twig code |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | $language = 'English'; |
431 | 431 | } |
432 | 432 | |
433 | - $className = 'PhpScience\\TextRank\\Tool\\StopWords\\' . ucfirst($language); |
|
433 | + $className = 'PhpScience\\TextRank\\Tool\\StopWords\\'.ucfirst($language); |
|
434 | 434 | if (class_exists($className)) { |
435 | 435 | $stopWords = new $className(); |
436 | 436 | } |
@@ -120,7 +120,7 @@ discard block |
||
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 |
||
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); |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | } |
240 | 240 | $canonicalUrl = UrlHelper::absoluteUrlWithProtocol($canonicalUrl); |
241 | 241 | if ($url !== $canonicalUrl) { |
242 | - Craft::info("Excluding URL: {$url} from the sitemap because it does not match the Canonical URL: {$canonicalUrl} - " . $metaBundle->metaGlobalVars->canonicalUrl . " - " . $element->uri); |
|
242 | + Craft::info("Excluding URL: {$url} from the sitemap because it does not match the Canonical URL: {$canonicalUrl} - ".$metaBundle->metaGlobalVars->canonicalUrl." - ".$element->uri); |
|
243 | 243 | continue; |
244 | 244 | } |
245 | 245 | } |
@@ -297,12 +297,12 @@ discard block |
||
297 | 297 | if ($primarySiteId === $altSourceSiteId && Seomatic::$settings->addXDefaultHrefLang) { |
298 | 298 | $lines[] = '<xhtml:link rel="alternate"' |
299 | 299 | . ' hreflang="x-default"' |
300 | - . ' href="' . Html::encode($altUrl) . '"' |
|
300 | + . ' href="'.Html::encode($altUrl).'"' |
|
301 | 301 | . ' />'; |
302 | 302 | } |
303 | 303 | $lines[] = '<xhtml:link rel="alternate"' |
304 | - . ' hreflang="' . $altSiteSettings['language'] . '"' |
|
305 | - . ' href="' . Html::encode($altUrl) . '"' |
|
304 | + . ' hreflang="'.$altSiteSettings['language'].'"' |
|
305 | + . ' href="'.Html::encode($altUrl).'"' |
|
306 | 306 | . ' />'; |
307 | 307 | } |
308 | 308 | } |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | } |
312 | 312 | } |
313 | 313 | // Handle news sitemaps https://developers.google.com/search/docs/crawling-indexing/sitemaps/news-sitemap |
314 | - if ((bool)$metaBundle->metaSitemapVars->newsSitemap) { |
|
314 | + if ((bool) $metaBundle->metaSitemapVars->newsSitemap) { |
|
315 | 315 | $now = new DateTime(); |
316 | 316 | $interval = $now->diff($dateUpdated); |
317 | 317 | if ($interval->days <= 2) { |
@@ -321,11 +321,11 @@ discard block |
||
321 | 321 | } |
322 | 322 | $lines[] = '<news:news>'; |
323 | 323 | $lines[] = '<news:publication>'; |
324 | - $lines[] = '<news:name>' . $metaBundle->metaSitemapVars->newsPublicationName . '</news:name>'; |
|
325 | - $lines[] = '<news:language>' . $language . '</news:language>'; |
|
324 | + $lines[] = '<news:name>'.$metaBundle->metaSitemapVars->newsPublicationName.'</news:name>'; |
|
325 | + $lines[] = '<news:language>'.$language.'</news:language>'; |
|
326 | 326 | $lines[] = '</news:publication>'; |
327 | - $lines[] = '<news:publication_date>' . $dateUpdated->format(DateTime::W3C) . '</news:publication_date>'; |
|
328 | - $lines[] = '<news:title>' . $element->title . '</news:title>'; |
|
327 | + $lines[] = '<news:publication_date>'.$dateUpdated->format(DateTime::W3C).'</news:publication_date>'; |
|
328 | + $lines[] = '<news:title>'.$element->title.'</news:title>'; |
|
329 | 329 | $lines[] = '</news:news>'; |
330 | 330 | } |
331 | 331 | } |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | |
510 | 510 | $attributes = array_intersect_key( |
511 | 511 | $attributes, |
512 | - array_flip((array)$seoSettingsField->sitemapEnabledFields) |
|
512 | + array_flip((array) $seoSettingsField->sitemapEnabledFields) |
|
513 | 513 | ); |
514 | 514 | $attributes = array_filter( |
515 | 515 | $attributes, |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | */ |
542 | 542 | protected static function assetSitemapItem(Asset $asset, MetaBundle $metaBundle, array &$lines) |
543 | 543 | { |
544 | - if ((bool)$asset->enabledForSite && $asset->getUrl() !== null) { |
|
544 | + if ((bool) $asset->enabledForSite && $asset->getUrl() !== null) { |
|
545 | 545 | switch ($asset->kind) { |
546 | 546 | case 'image': |
547 | 547 | $transform = Craft::$app->getImageTransforms()->getTransformByHandle($metaBundle->metaSitemapVars->sitemapAssetTransform ?? ''); |
@@ -554,9 +554,9 @@ discard block |
||
554 | 554 | $fieldName = $row['field'] ?? ''; |
555 | 555 | $propName = $row['property'] ?? ''; |
556 | 556 | if (!empty($fieldName) && !empty($asset[$fieldName]) && !empty($propName)) { |
557 | - $lines[] = '<image:' . $propName . '>'; |
|
557 | + $lines[] = '<image:'.$propName.'>'; |
|
558 | 558 | $lines[] = Html::encode($asset[$fieldName]); |
559 | - $lines[] = '</image:' . $propName . '>'; |
|
559 | + $lines[] = '</image:'.$propName.'>'; |
|
560 | 560 | } |
561 | 561 | } |
562 | 562 | $lines[] = '</image:image>'; |
@@ -572,9 +572,9 @@ discard block |
||
572 | 572 | $fieldName = $row['field'] ?? ''; |
573 | 573 | $propName = $row['property'] ?? ''; |
574 | 574 | if (!empty($fieldName) && !empty($asset[$fieldName]) && !empty($propName)) { |
575 | - $lines[] = '<video:' . $propName . '>'; |
|
575 | + $lines[] = '<video:'.$propName.'>'; |
|
576 | 576 | $lines[] = Html::encode($asset[$fieldName]); |
577 | - $lines[] = '</video:' . $propName . '>'; |
|
577 | + $lines[] = '</video:'.$propName.'>'; |
|
578 | 578 | } |
579 | 579 | } |
580 | 580 | $lines[] = '</video:video>'; |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | */ |
591 | 591 | protected static function assetFilesSitemapLink(Asset $asset, MetaBundle $metaBundle, array &$lines) |
592 | 592 | { |
593 | - if ((bool)$asset->enabledForSite && $asset->getUrl() !== null) { |
|
593 | + if ((bool) $asset->enabledForSite && $asset->getUrl() !== null) { |
|
594 | 594 | if (in_array($asset->kind, SitemapTemplate::FILE_TYPES, false)) { |
595 | 595 | $dateUpdated = $asset->dateUpdated ?? $asset->dateCreated ?? new DateTime(); |
596 | 596 | $lines[] = '<url>'; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | /** |
112 | 112 | * @inheritdoc |
113 | 113 | */ |
114 | - public static function dbType(): array|string|null |
|
114 | + public static function dbType(): array | string | null |
|
115 | 115 | { |
116 | 116 | return Schema::TYPE_TEXT; |
117 | 117 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | } |
240 | 240 | // Handle the mainEntityOfPage |
241 | 241 | $mainEntity = ''; |
242 | - if (in_array('mainEntityOfPage', (array)$this->generalEnabledFields, false) && |
|
242 | + if (in_array('mainEntityOfPage', (array) $this->generalEnabledFields, false) && |
|
243 | 243 | !empty($config['metaBundleSettings'])) { |
244 | 244 | $mainEntity = SchemaHelper::getSpecificEntityType($config['metaBundleSettings'], true); |
245 | 245 | } |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | if ($element !== null && $element->uri !== null) { |
394 | 394 | $siteId = $element->siteId; |
395 | 395 | $uri = $element->uri; |
396 | - $cacheKey = self::CACHE_KEY . $uri . $siteId . $this->elementDisplayPreviewType; |
|
396 | + $cacheKey = self::CACHE_KEY.$uri.$siteId.$this->elementDisplayPreviewType; |
|
397 | 397 | $metaBundleSourceType = Seomatic::$plugin->seoElements->getMetaBundleTypeFromElement($element); |
398 | 398 | $seoElement = Seomatic::$plugin->seoElements->getSeoElementByMetaBundleType($metaBundleSourceType); |
399 | 399 | $metaBundleSourceType = SeoEntry::getMetaBundleType(); |
@@ -404,14 +404,14 @@ discard block |
||
404 | 404 | $dependency = new TagDependency([ |
405 | 405 | 'tags' => [ |
406 | 406 | MetaContainers::GLOBAL_METACONTAINER_CACHE_TAG, |
407 | - MetaContainers::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId, |
|
408 | - MetaContainers::METACONTAINER_CACHE_TAG . $uri . $siteId, |
|
407 | + MetaContainers::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId, |
|
408 | + MetaContainers::METACONTAINER_CACHE_TAG.$uri.$siteId, |
|
409 | 409 | ], |
410 | 410 | ]); |
411 | 411 | $cache = Craft::$app->getCache(); |
412 | 412 | $cacheDuration = null; |
413 | 413 | $html = $cache->getOrSet( |
414 | - self::CACHE_KEY . $cacheKey, |
|
414 | + self::CACHE_KEY.$cacheKey, |
|
415 | 415 | function() use ($uri, $siteId, $element) { |
416 | 416 | Seomatic::$plugin->metaContainers->previewMetaContainers($uri, $siteId, true, true, $element); |
417 | 417 | $variables = [ |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | array &$variables, |
454 | 454 | ) { |
455 | 455 | $variables['textFieldSources'] = array_merge( |
456 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'], |
|
456 | + ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'], |
|
457 | 457 | FieldHelper::fieldsOfTypeFromElement( |
458 | 458 | $element, |
459 | 459 | FieldHelper::TEXT_FIELD_CLASS_KEY, |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | ) |
462 | 462 | ); |
463 | 463 | $variables['assetFieldSources'] = array_merge( |
464 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields']], |
|
464 | + ['entryGroup' => ['optgroup' => $groupName.' Fields']], |
|
465 | 465 | FieldHelper::fieldsOfTypeFromElement( |
466 | 466 | $element, |
467 | 467 | FieldHelper::ASSET_FIELD_CLASS_KEY, |
@@ -43,11 +43,11 @@ discard block |
||
43 | 43 | // Constants |
44 | 44 | // ========================================================================= |
45 | 45 | |
46 | - public const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapIndexTemplate::TEMPLATE_TYPE; |
|
46 | + public const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapIndexTemplate::TEMPLATE_TYPE; |
|
47 | 47 | |
48 | - public const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapTemplate::TEMPLATE_TYPE; |
|
48 | + public const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapTemplate::TEMPLATE_TYPE; |
|
49 | 49 | |
50 | - public const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapCustomTemplate::TEMPLATE_TYPE; |
|
50 | + public const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapCustomTemplate::TEMPLATE_TYPE; |
|
51 | 51 | |
52 | 52 | public const SEARCH_ENGINE_SUBMISSION_URLS = [ |
53 | 53 | ]; |
@@ -238,19 +238,19 @@ discard block |
||
238 | 238 | $siteId = $groupSiteIds[0]; |
239 | 239 | $sitemapIndexUrl = $this->sitemapIndexUrlForSiteId($siteId); |
240 | 240 | if (!empty($sitemapIndexUrl)) { |
241 | - $submissionUrl = $url . urlencode($sitemapIndexUrl); |
|
241 | + $submissionUrl = $url.urlencode($sitemapIndexUrl); |
|
242 | 242 | // create new guzzle client |
243 | 243 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
244 | 244 | // Submit the sitemap index to each search engine |
245 | 245 | try { |
246 | 246 | $guzzleClient->post($submissionUrl); |
247 | 247 | Craft::info( |
248 | - 'Sitemap index submitted to: ' . $submissionUrl, |
|
248 | + 'Sitemap index submitted to: '.$submissionUrl, |
|
249 | 249 | __METHOD__ |
250 | 250 | ); |
251 | 251 | } catch (\Exception $e) { |
252 | 252 | Craft::error( |
253 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
253 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
254 | 254 | __METHOD__ |
255 | 255 | ); |
256 | 256 | } |
@@ -312,19 +312,19 @@ discard block |
||
312 | 312 | foreach ($searchEngineUrls as &$url) { |
313 | 313 | $sitemapUrl = $this->sitemapUrlForBundle($sourceBundleType, $sourceHandle, $sourceSiteId); |
314 | 314 | if (!empty($sitemapUrl)) { |
315 | - $submissionUrl = $url . urlencode($sitemapUrl); |
|
315 | + $submissionUrl = $url.urlencode($sitemapUrl); |
|
316 | 316 | // create new guzzle client |
317 | 317 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
318 | 318 | // Submit the sitemap index to each search engine |
319 | 319 | try { |
320 | 320 | $guzzleClient->post($submissionUrl); |
321 | 321 | Craft::info( |
322 | - 'Sitemap index submitted to: ' . $submissionUrl, |
|
322 | + 'Sitemap index submitted to: '.$submissionUrl, |
|
323 | 323 | __METHOD__ |
324 | 324 | ); |
325 | 325 | } catch (\Exception $e) { |
326 | 326 | Craft::error( |
327 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
327 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
328 | 328 | __METHOD__ |
329 | 329 | ); |
330 | 330 | } |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | . '-' |
366 | 366 | . $metaBundle->sourceSiteId |
367 | 367 | . '-sitemap' |
368 | - . (!empty($page) ? '-p' . $page : '') |
|
368 | + . (!empty($page) ? '-p'.$page : '') |
|
369 | 369 | . '.xml', |
370 | 370 | null, |
371 | 371 | null, |
@@ -394,19 +394,19 @@ discard block |
||
394 | 394 | foreach ($searchEngineUrls as &$url) { |
395 | 395 | $sitemapUrl = $this->sitemapCustomUrlForSiteId($siteId); |
396 | 396 | if (!empty($sitemapUrl)) { |
397 | - $submissionUrl = $url . urlencode($sitemapUrl); |
|
397 | + $submissionUrl = $url.urlencode($sitemapUrl); |
|
398 | 398 | // create new guzzle client |
399 | 399 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
400 | 400 | // Submit the sitemap index to each search engine |
401 | 401 | try { |
402 | 402 | $guzzleClient->post($submissionUrl); |
403 | 403 | Craft::info( |
404 | - 'Sitemap Custom submitted to: ' . $submissionUrl, |
|
404 | + 'Sitemap Custom submitted to: '.$submissionUrl, |
|
405 | 405 | __METHOD__ |
406 | 406 | ); |
407 | 407 | } catch (\Exception $e) { |
408 | 408 | Craft::error( |
409 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
409 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
410 | 410 | __METHOD__ |
411 | 411 | ); |
412 | 412 | } |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | } |
485 | 485 | |
486 | 486 | foreach ($sites as $site) { |
487 | - $result .= 'sitemap: ' . $this->sitemapIndexUrlForSiteId($site->id) . PHP_EOL; |
|
487 | + $result .= 'sitemap: '.$this->sitemapIndexUrlForSiteId($site->id).PHP_EOL; |
|
488 | 488 | } |
489 | 489 | |
490 | 490 | return rtrim($result, PHP_EOL); |
@@ -515,9 +515,9 @@ discard block |
||
515 | 515 | { |
516 | 516 | // Always just invalidate the sitemap cache now, since we're doing paginated sitemaps |
517 | 517 | $cache = Craft::$app->getCache(); |
518 | - TagDependency::invalidate($cache, SitemapTemplate::SITEMAP_CACHE_TAG . $handle . $siteId); |
|
518 | + TagDependency::invalidate($cache, SitemapTemplate::SITEMAP_CACHE_TAG.$handle.$siteId); |
|
519 | 519 | Craft::info( |
520 | - 'Sitemap cache cleared: ' . $handle, |
|
520 | + 'Sitemap cache cleared: '.$handle, |
|
521 | 521 | __METHOD__ |
522 | 522 | ); |
523 | 523 | } |
@@ -182,7 +182,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 */ |
@@ -90,24 +90,24 @@ |
||
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 |
@@ -140,10 +140,10 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | ->limit($metaBundle->metaSitemapVars->sitemapLimit); |
224 | 224 | if ($metaBundle->sourceType === 'structure' |
225 | 225 | && !empty($metaBundle->metaSitemapVars->structureDepth)) { |
226 | - $query->level('<=' . $metaBundle->metaSitemapVars->structureDepth); |
|
226 | + $query->level('<='.$metaBundle->metaSitemapVars->structureDepth); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | return $query; |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | if (!empty($typeId)) { |
272 | 272 | $query |
273 | 273 | ->andWhere([ |
274 | - 'typeId' => (int)$typeId, |
|
274 | + 'typeId' => (int) $typeId, |
|
275 | 275 | ]); |
276 | 276 | } |
277 | 277 | $element = $query->one(); |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
399 | 399 | [ |
400 | 400 | 'sourceId' => $sourceModel->id, |
401 | - 'sourceName' => (string)$sourceModel->name, |
|
401 | + 'sourceName' => (string) $sourceModel->name, |
|
402 | 402 | 'sourceHandle' => $sourceModel->handle, |
403 | 403 | 'sourceType' => $sourceModel->type, |
404 | 404 | ] |
@@ -508,8 +508,8 @@ discard block |
||
508 | 508 | string $sourceBundleType, |
509 | 509 | string $sourceHandle, |
510 | 510 | string $siteHandle = null, |
511 | - $typeId = null, |
|
512 | - $loadFromSiteHandle = null, |
|
511 | + $typeId = null, |
|
512 | + $loadFromSiteHandle = null, |
|
513 | 513 | ): Response { |
514 | 514 | $variables = []; |
515 | 515 | // @TODO: Let people choose an entry/categorygroup/product as the preview |
@@ -1222,7 +1222,7 @@ discard block |
||
1222 | 1222 | string $sourceHandle, |
1223 | 1223 | string $groupName, |
1224 | 1224 | array &$variables, |
1225 | - $typeId = null, |
|
1225 | + $typeId = null, |
|
1226 | 1226 | ) { |
1227 | 1227 | $variables['textFieldSources'] = array_merge( |
1228 | 1228 | ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'], |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | /** |
91 | 91 | * @inheritdoc |
92 | 92 | */ |
93 | - protected array|bool|int $allowAnonymous = [ |
|
93 | + protected array | bool | int $allowAnonymous = [ |
|
94 | 94 | ]; |
95 | 95 | |
96 | 96 | // Public Methods |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $variables['pluginName'] = Seomatic::$settings->pluginName; |
135 | 135 | $variables['title'] = $templateTitle; |
136 | 136 | $variables['docTitle'] = "{$pluginName} - {$templateTitle}"; |
137 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
137 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
138 | 138 | $variables['crumbs'] = [ |
139 | 139 | [ |
140 | 140 | 'label' => $pluginName, |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | ], |
143 | 143 | [ |
144 | 144 | 'label' => $templateTitle, |
145 | - 'url' => UrlHelper::cpUrl('seomatic/dashboard' . $siteHandleUri), |
|
145 | + 'url' => UrlHelper::cpUrl('seomatic/dashboard'.$siteHandleUri), |
|
146 | 146 | ], |
147 | 147 | ]; |
148 | 148 | $variables['selectedSubnavItem'] = 'dashboard'; |
@@ -165,11 +165,11 @@ discard block |
||
165 | 165 | foreach ($variables['metaBundles'] as $metaBundle) { |
166 | 166 | $stat = 0; |
167 | 167 | foreach (self::SEO_SETUP_FIELDS as $setupField => $setupLabel) { |
168 | - $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]); |
|
168 | + $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]); |
|
169 | 169 | $value = $variables['contentSetupChecklist'][$setupField]['value'] ?? 0; |
170 | 170 | $variables['contentSetupChecklist'][$setupField] = [ |
171 | 171 | 'label' => $setupLabel, |
172 | - 'value' => $value + (int)!empty($metaBundle->metaGlobalVars[$setupField]), |
|
172 | + 'value' => $value + (int) !empty($metaBundle->metaGlobalVars[$setupField]), |
|
173 | 173 | ]; |
174 | 174 | } |
175 | 175 | $stat = round($numGrades - (($stat * $numGrades) / $numFields)); |
@@ -180,16 +180,16 @@ discard block |
||
180 | 180 | } |
181 | 181 | // Global SEO grades |
182 | 182 | Seomatic::$previewingMetaContainers = true; |
183 | - $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int)$siteId); |
|
183 | + $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int) $siteId); |
|
184 | 184 | Seomatic::$previewingMetaContainers = false; |
185 | 185 | if ($metaBundle !== null) { |
186 | 186 | $stat = 0; |
187 | 187 | $variables['globalSetupChecklist'] = []; |
188 | 188 | foreach (self::SEO_SETUP_FIELDS as $setupField => $setupLabel) { |
189 | - $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]); |
|
189 | + $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]); |
|
190 | 190 | $variables['globalSetupChecklist'][$setupField] = [ |
191 | 191 | 'label' => $setupLabel, |
192 | - 'value' => (int)!empty($metaBundle->metaGlobalVars[$setupField]), |
|
192 | + 'value' => (int) !empty($metaBundle->metaGlobalVars[$setupField]), |
|
193 | 193 | ]; |
194 | 194 | } |
195 | 195 | $stat = round(($stat / $numFields) * 100); |
@@ -199,17 +199,17 @@ discard block |
||
199 | 199 | $stat = 0; |
200 | 200 | $variables['siteSetupChecklist'] = []; |
201 | 201 | foreach (self::SITE_SETUP_FIELDS as $setupField => $setupLabel) { |
202 | - $stat += (int)!empty($metaBundle->metaSiteVars[$setupField]); |
|
202 | + $stat += (int) !empty($metaBundle->metaSiteVars[$setupField]); |
|
203 | 203 | $variables['siteSetupChecklist'][$setupField] = [ |
204 | 204 | 'label' => $setupLabel, |
205 | - 'value' => (int)!empty($metaBundle->metaSiteVars[$setupField]), |
|
205 | + 'value' => (int) !empty($metaBundle->metaSiteVars[$setupField]), |
|
206 | 206 | ]; |
207 | 207 | } |
208 | 208 | foreach (self::IDENTITY_SETUP_FIELDS as $setupField => $setupLabel) { |
209 | - $stat += (int)!empty($metaBundle->metaSiteVars->identity[$setupField]); |
|
209 | + $stat += (int) !empty($metaBundle->metaSiteVars->identity[$setupField]); |
|
210 | 210 | $variables['siteSetupChecklist'][$setupField] = [ |
211 | 211 | 'label' => $setupLabel, |
212 | - 'value' => (int)!empty($metaBundle->metaSiteVars->identity[$setupField]), |
|
212 | + 'value' => (int) !empty($metaBundle->metaSiteVars->identity[$setupField]), |
|
213 | 213 | ]; |
214 | 214 | } |
215 | 215 | $stat = round(($stat / $numFields) * 100); |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | $variables['title'] = $templateTitle; |
259 | 259 | $variables['subSectionTitle'] = $subSectionTitle; |
260 | 260 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
261 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
261 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
262 | 262 | $variables['crumbs'] = [ |
263 | 263 | [ |
264 | 264 | 'label' => $pluginName, |
@@ -266,11 +266,11 @@ discard block |
||
266 | 266 | ], |
267 | 267 | [ |
268 | 268 | 'label' => $templateTitle, |
269 | - 'url' => UrlHelper::cpUrl('seomatic/global/general' . $siteHandleUri), |
|
269 | + 'url' => UrlHelper::cpUrl('seomatic/global/general'.$siteHandleUri), |
|
270 | 270 | ], |
271 | 271 | [ |
272 | 272 | 'label' => $subSectionTitle, |
273 | - 'url' => UrlHelper::cpUrl('seomatic/global/' . $subSection . $siteHandleUri), |
|
273 | + 'url' => UrlHelper::cpUrl('seomatic/global/'.$subSection.$siteHandleUri), |
|
274 | 274 | ], |
275 | 275 | ]; |
276 | 276 | $variables['selectedSubnavItem'] = 'global'; |
@@ -278,14 +278,14 @@ discard block |
||
278 | 278 | $this->setGlobalFieldSourceVariables($variables); |
279 | 279 | // Enabled sites |
280 | 280 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
281 | - $variables['controllerHandle'] = 'global' . '/' . $subSection; |
|
281 | + $variables['controllerHandle'] = 'global'.'/'.$subSection; |
|
282 | 282 | $variables['currentSubSection'] = $subSection; |
283 | 283 | // Meta bundle settings |
284 | 284 | Seomatic::$previewingMetaContainers = true; |
285 | 285 | // Get the site to copy the settings from, if any |
286 | 286 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
287 | 287 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
288 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
288 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
289 | 289 | // Load the metabundle |
290 | 290 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
291 | 291 | if ($editedMetaBundle) { |
@@ -339,13 +339,13 @@ discard block |
||
339 | 339 | // Preview the meta containers |
340 | 340 | Seomatic::$plugin->metaContainers->previewMetaContainers( |
341 | 341 | MetaBundles::GLOBAL_META_BUNDLE, |
342 | - (int)$variables['currentSiteId'] |
|
342 | + (int) $variables['currentSiteId'] |
|
343 | 343 | ); |
344 | 344 | |
345 | 345 | $this->setCrumbVariables($variables); |
346 | 346 | |
347 | 347 | // Render the template |
348 | - return $this->renderTemplate('seomatic/settings/global/' . $subSection, $variables); |
|
348 | + return $this->renderTemplate('seomatic/settings/global/'.$subSection, $variables); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | /** |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | $variables['pluginName'] = Seomatic::$settings->pluginName; |
478 | 478 | $variables['title'] = $templateTitle; |
479 | 479 | $variables['docTitle'] = "{$pluginName} - {$templateTitle}"; |
480 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
480 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
481 | 481 | $variables['crumbs'] = [ |
482 | 482 | [ |
483 | 483 | 'label' => $pluginName, |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | ], |
486 | 486 | [ |
487 | 487 | 'label' => $templateTitle, |
488 | - 'url' => UrlHelper::cpUrl('seomatic/content' . $siteHandleUri), |
|
488 | + 'url' => UrlHelper::cpUrl('seomatic/content'.$siteHandleUri), |
|
489 | 489 | ], |
490 | 490 | ]; |
491 | 491 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | $siteHandle = $this->getCpSiteHandle($siteHandle); |
528 | 528 | $siteId = $this->getSiteIdFromHandle($siteHandle); |
529 | 529 | if (is_string($typeId)) { |
530 | - $typeId = (int)$typeId; |
|
530 | + $typeId = (int) $typeId; |
|
531 | 531 | } |
532 | 532 | // Get the (entry) type menu |
533 | 533 | $typeMenu = []; |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | $currentType = reset($typeMenu); |
543 | 543 | $variables['currentType'] = $typeMenu[$typeId] ?? $currentType; |
544 | 544 | $variables['currentTypeId'] = $typeId ?? key($typeMenu); |
545 | - $typeId = (int)$variables['currentTypeId']; |
|
545 | + $typeId = (int) $variables['currentTypeId']; |
|
546 | 546 | } |
547 | 547 | // If there's only one EntryType, don't bother displaying the menu |
548 | 548 | if (count($typeMenu) === 1) { |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | // Get the site to copy the settings from, if any |
569 | 569 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
570 | 570 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
571 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
571 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
572 | 572 | // Load the metabundle |
573 | 573 | $metaBundle = Seomatic::$plugin->metaBundles->getMetaBundleBySourceHandle( |
574 | 574 | $sourceBundleType, |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | $variables['title'] = $templateTitle; |
595 | 595 | $variables['subSectionTitle'] = $subSectionTitle; |
596 | 596 | $variables['docTitle'] = "{$pluginName} - Content SEO - {$templateTitle} - {$subSectionTitle}"; |
597 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
597 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
598 | 598 | $variables['siteHandleUri'] = $siteHandleUri; |
599 | 599 | $variables['crumbs'] = [ |
600 | 600 | [ |
@@ -603,10 +603,10 @@ discard block |
||
603 | 603 | ], |
604 | 604 | [ |
605 | 605 | 'label' => 'Content SEO', |
606 | - 'url' => UrlHelper::cpUrl('seomatic/content' . $siteHandleUri), |
|
606 | + 'url' => UrlHelper::cpUrl('seomatic/content'.$siteHandleUri), |
|
607 | 607 | ], |
608 | 608 | [ |
609 | - 'label' => $metaBundle->sourceName . ' · ' . $subSectionTitle, |
|
609 | + 'label' => $metaBundle->sourceName.' · '.$subSectionTitle, |
|
610 | 610 | 'url' => UrlHelper::cpUrl("seomatic/edit-content/{$subSection}/{$sourceBundleType}/{$sourceHandle}"), |
611 | 611 | ], |
612 | 612 | ]; |
@@ -637,13 +637,13 @@ discard block |
||
637 | 637 | // Preview the meta containers |
638 | 638 | Seomatic::$plugin->metaContainers->previewMetaContainers( |
639 | 639 | $uri, |
640 | - (int)$variables['currentSiteId'], |
|
640 | + (int) $variables['currentSiteId'], |
|
641 | 641 | false, |
642 | 642 | false |
643 | 643 | ); |
644 | 644 | |
645 | 645 | // Render the template |
646 | - return $this->renderTemplate('seomatic/settings/content/' . $subSection, $variables); |
|
646 | + return $this->renderTemplate('seomatic/settings/content/'.$subSection, $variables); |
|
647 | 647 | } |
648 | 648 | |
649 | 649 | /** |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | $bundleSettings = $request->getParam('metaBundleSettings'); |
665 | 665 | $sitemapSettings = $request->getParam('metaSitemapVars'); |
666 | 666 | if (is_string($typeId)) { |
667 | - $typeId = (int)$typeId; |
|
667 | + $typeId = (int) $typeId; |
|
668 | 668 | } |
669 | 669 | // Set the element type in the template |
670 | 670 | $elementName = ''; |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | if ($subSection === 'social') { |
737 | 737 | $subSectionSuffix = ' Media'; |
738 | 738 | } |
739 | - $subSectionTitle = Craft::t('seomatic', ucfirst($subSection) . $subSectionSuffix); |
|
739 | + $subSectionTitle = Craft::t('seomatic', ucfirst($subSection).$subSectionSuffix); |
|
740 | 740 | // Asset bundle |
741 | 741 | try { |
742 | 742 | Seomatic::$view->registerAssetBundle(SeomaticAsset::class); |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | $variables['title'] = $templateTitle; |
755 | 755 | $variables['subSectionTitle'] = $subSectionTitle; |
756 | 756 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
757 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
757 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
758 | 758 | $variables['crumbs'] = [ |
759 | 759 | [ |
760 | 760 | 'label' => $pluginName, |
@@ -762,11 +762,11 @@ discard block |
||
762 | 762 | ], |
763 | 763 | [ |
764 | 764 | 'label' => $templateTitle, |
765 | - 'url' => UrlHelper::cpUrl('seomatic/site/identity' . $siteHandleUri), |
|
765 | + 'url' => UrlHelper::cpUrl('seomatic/site/identity'.$siteHandleUri), |
|
766 | 766 | ], |
767 | 767 | [ |
768 | 768 | 'label' => $subSectionTitle, |
769 | - 'url' => UrlHelper::cpUrl('seomatic/site/' . $subSection . $siteHandleUri), |
|
769 | + 'url' => UrlHelper::cpUrl('seomatic/site/'.$subSection.$siteHandleUri), |
|
770 | 770 | ], |
771 | 771 | ]; |
772 | 772 | $variables['selectedSubnavItem'] = 'site'; |
@@ -774,14 +774,14 @@ discard block |
||
774 | 774 | |
775 | 775 | // Enabled sites |
776 | 776 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
777 | - $variables['controllerHandle'] = 'site' . '/' . $subSection; |
|
777 | + $variables['controllerHandle'] = 'site'.'/'.$subSection; |
|
778 | 778 | |
779 | 779 | // The site settings for the appropriate meta bundle |
780 | 780 | Seomatic::$previewingMetaContainers = true; |
781 | 781 | // Get the site to copy the settings from, if any |
782 | 782 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
783 | 783 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
784 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
784 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
785 | 785 | // Load the metabundle |
786 | 786 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
787 | 787 | Seomatic::$previewingMetaContainers = false; |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | $this->setCrumbVariables($variables); |
801 | 801 | |
802 | 802 | // Render the template |
803 | - return $this->renderTemplate('seomatic/settings/site/' . $subSection, $variables); |
|
803 | + return $this->renderTemplate('seomatic/settings/site/'.$subSection, $variables); |
|
804 | 804 | } |
805 | 805 | |
806 | 806 | /** |
@@ -932,7 +932,7 @@ discard block |
||
932 | 932 | $siteId = $this->getSiteIdFromHandle($siteHandle); |
933 | 933 | // Enabled sites |
934 | 934 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
935 | - $variables['controllerHandle'] = 'tracking' . '/' . $subSection; |
|
935 | + $variables['controllerHandle'] = 'tracking'.'/'.$subSection; |
|
936 | 936 | $variables['currentSubSection'] = $subSection; |
937 | 937 | |
938 | 938 | // The script meta containers for the global meta bundle |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | // Get the site to copy the settings from, if any |
941 | 941 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
942 | 942 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
943 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
943 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
944 | 944 | // Load the metabundle |
945 | 945 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
946 | 946 | if ($editedMetaBundle) { |
@@ -980,7 +980,7 @@ discard block |
||
980 | 980 | $variables['title'] = $templateTitle; |
981 | 981 | $variables['subSectionTitle'] = $subSectionTitle; |
982 | 982 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
983 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
983 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
984 | 984 | $variables['crumbs'] = [ |
985 | 985 | [ |
986 | 986 | 'label' => $pluginName, |
@@ -992,7 +992,7 @@ discard block |
||
992 | 992 | ], |
993 | 993 | [ |
994 | 994 | 'label' => $subSectionTitle, |
995 | - 'url' => UrlHelper::cpUrl('seomatic/tracking/' . $subSection . $siteHandleUri), |
|
995 | + 'url' => UrlHelper::cpUrl('seomatic/tracking/'.$subSection.$siteHandleUri), |
|
996 | 996 | ], |
997 | 997 | ]; |
998 | 998 | $variables['selectedSubnavItem'] = 'tracking'; |
@@ -1146,7 +1146,7 @@ discard block |
||
1146 | 1146 | if ($siteHandle !== null) { |
1147 | 1147 | $site = Craft::$app->getSites()->getSiteByHandle($siteHandle); |
1148 | 1148 | if (!$site) { |
1149 | - throw new NotFoundHttpException('Invalid site handle: ' . $siteHandle); |
|
1149 | + throw new NotFoundHttpException('Invalid site handle: '.$siteHandle); |
|
1150 | 1150 | } |
1151 | 1151 | $siteId = $site->id; |
1152 | 1152 | } else { |
@@ -1183,7 +1183,7 @@ discard block |
||
1183 | 1183 | if (!empty($variables['enabledSiteIds'])) { |
1184 | 1184 | $siteId = reset($variables['enabledSiteIds']); |
1185 | 1185 | } else { |
1186 | - $this->requirePermission('editSite:' . $siteId); |
|
1186 | + $this->requirePermission('editSite:'.$siteId); |
|
1187 | 1187 | } |
1188 | 1188 | } |
1189 | 1189 | } |
@@ -1257,7 +1257,7 @@ discard block |
||
1257 | 1257 | 'icon' => 'world', |
1258 | 1258 | 'label' => Craft::t( |
1259 | 1259 | 'site', |
1260 | - $sites->getSiteById((int)$variables['currentSiteId'])->name |
|
1260 | + $sites->getSiteById((int) $variables['currentSiteId'])->name |
|
1261 | 1261 | ), |
1262 | 1262 | 'menu' => [ |
1263 | 1263 | 'items' => $siteCrumbItems, |
@@ -1294,7 +1294,7 @@ discard block |
||
1294 | 1294 | |
1295 | 1295 | $variables['sitesMenuLabel'] = Craft::t( |
1296 | 1296 | 'site', |
1297 | - $sites->getSiteById((int)$variables['currentSiteId'])->name |
|
1297 | + $sites->getSiteById((int) $variables['currentSiteId'])->name |
|
1298 | 1298 | ); |
1299 | 1299 | } else { |
1300 | 1300 | $variables['sitesMenuLabel'] = ''; |
@@ -1374,7 +1374,7 @@ discard block |
||
1374 | 1374 | $typeId = null, |
1375 | 1375 | ) { |
1376 | 1376 | $variables['textFieldSources'] = array_merge( |
1377 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'], |
|
1377 | + ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'], |
|
1378 | 1378 | FieldHelper::fieldsOfTypeFromSource( |
1379 | 1379 | $sourceBundleType, |
1380 | 1380 | $sourceHandle, |
@@ -1384,7 +1384,7 @@ discard block |
||
1384 | 1384 | ) |
1385 | 1385 | ); |
1386 | 1386 | $variables['assetFieldSources'] = array_merge( |
1387 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields']], |
|
1387 | + ['entryGroup' => ['optgroup' => $groupName.' Fields']], |
|
1388 | 1388 | FieldHelper::fieldsOfTypeFromSource( |
1389 | 1389 | $sourceBundleType, |
1390 | 1390 | $sourceHandle, |