@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | { |
85 | 85 | if ($pageInfo !== null && $pageInfo->currentPage !== null) { |
86 | 86 | // Let the meta containers know that this page is paginated |
87 | - Seomatic::$plugin->metaContainers->paginationPage = (string)$pageInfo->currentPage; |
|
87 | + Seomatic::$plugin->metaContainers->paginationPage = (string) $pageInfo->currentPage; |
|
88 | 88 | // See if we should strip the query params |
89 | 89 | $stripQueryParams = true; |
90 | 90 | $pageTrigger = Craft::$app->getConfig()->getGeneral()->pageTrigger; |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | if (is_array($content)) { |
158 | 158 | $headerValue = ''; |
159 | 159 | foreach ($content as $contentVal) { |
160 | - $headerValue .= ($contentVal . ','); |
|
160 | + $headerValue .= ($contentVal.','); |
|
161 | 161 | } |
162 | 162 | $headerValue = rtrim($headerValue, ','); |
163 | 163 | } else { |
@@ -176,11 +176,11 @@ discard block |
||
176 | 176 | if (is_array($href)) { |
177 | 177 | $headerValue = ''; |
178 | 178 | foreach ($href as $hrefVal) { |
179 | - $headerValue .= ('<' . $hrefVal . '>' . ','); |
|
179 | + $headerValue .= ('<'.$hrefVal.'>'.','); |
|
180 | 180 | } |
181 | 181 | $headerValue = rtrim($headerValue, ','); |
182 | 182 | } else { |
183 | - $headerValue = '<' . $href . '>'; |
|
183 | + $headerValue = '<'.$href.'>'; |
|
184 | 184 | } |
185 | 185 | $headerValue .= "; rel='canonical'"; |
186 | 186 | $response->headers->add('Link', $headerValue); |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | if (is_array($content)) { |
197 | 197 | $headerValue = ''; |
198 | 198 | foreach ($content as $contentVal) { |
199 | - $headerValue .= ($contentVal . ','); |
|
199 | + $headerValue .= ($contentVal.','); |
|
200 | 200 | } |
201 | 201 | $headerValue = rtrim($headerValue, ','); |
202 | 202 | } else { |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | if ($lastElement && $element) { |
383 | 383 | if ($lastElement->uri !== '__home__' && $element->uri) { |
384 | 384 | $path = $lastElement->uri; |
385 | - $segments = array_values(array_filter(explode('/', $path), function ($segment) { |
|
385 | + $segments = array_values(array_filter(explode('/', $path), function($segment) { |
|
386 | 386 | return $segment !== ''; |
387 | 387 | })); |
388 | 388 | } |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | $element = $elements->getElementByUri($url, $site->id, false); |
543 | 543 | } |
544 | 544 | if ($element !== null) { |
545 | - if (isset($element->enabledForSite) && !(bool)$element->enabledForSite) { |
|
545 | + if (isset($element->enabledForSite) && !(bool) $element->enabledForSite) { |
|
546 | 546 | $includeUrl = false; |
547 | 547 | } |
548 | 548 | /** @var MetaBundle $metaBundle */ |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | if (isset($value[$day][$time]) |
796 | 796 | && ($date = DateTimeHelper::toDateTime($value[$day][$time])) !== false |
797 | 797 | ) { |
798 | - $normalized[$day][$time] = (array)($date); |
|
798 | + $normalized[$day][$time] = (array) ($date); |
|
799 | 799 | } else { |
800 | 800 | $normalized[$day][$time] = null; |
801 | 801 | } |
@@ -81,24 +81,24 @@ |
||
81 | 81 | $metaContainers = Seomatic::$plugin->metaContainers; |
82 | 82 | // Get our cache key |
83 | 83 | $asArrayKey = $asArray ? 'true' : 'false'; |
84 | - $cacheKey = $uri . $siteId . implode($containerKeys) . $asArrayKey . Seomatic::$environment; |
|
84 | + $cacheKey = $uri.$siteId.implode($containerKeys).$asArrayKey.Seomatic::$environment; |
|
85 | 85 | // Load the meta containers |
86 | 86 | $dependency = new TagDependency([ |
87 | 87 | 'tags' => [ |
88 | 88 | $metaContainers::GLOBAL_METACONTAINER_CACHE_TAG, |
89 | - $metaContainers::METACONTAINER_CACHE_TAG . $sourceId . $sourceBundleType . $siteId, |
|
90 | - $metaContainers::METACONTAINER_CACHE_TAG . $uri . $siteId, |
|
91 | - $metaContainers::METACONTAINER_CACHE_TAG . $cacheKey, |
|
89 | + $metaContainers::METACONTAINER_CACHE_TAG.$sourceId.$sourceBundleType.$siteId, |
|
90 | + $metaContainers::METACONTAINER_CACHE_TAG.$uri.$siteId, |
|
91 | + $metaContainers::METACONTAINER_CACHE_TAG.$cacheKey, |
|
92 | 92 | ], |
93 | 93 | ]); |
94 | 94 | |
95 | 95 | $cache = Craft::$app->getCache(); |
96 | 96 | $result = $cache->getOrSet( |
97 | - self::CACHE_KEY . $cacheKey, |
|
98 | - function () use ($uri, $siteId, $containerKeys, $asArray) { |
|
97 | + self::CACHE_KEY.$cacheKey, |
|
98 | + function() use ($uri, $siteId, $containerKeys, $asArray) { |
|
99 | 99 | $result = []; |
100 | 100 | Craft::info( |
101 | - 'Meta controller container cache miss: ' . $uri . '/' . $siteId, |
|
101 | + 'Meta controller container cache miss: '.$uri.'/'.$siteId, |
|
102 | 102 | __METHOD__ |
103 | 103 | ); |
104 | 104 | // Load the meta containers and parse our globals |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | $metaValue = Craft::t( |
295 | 295 | 'seomatic', |
296 | 296 | 'Error rendering `{template}` -> {error}', |
297 | - ['template' => $metaValue, 'error' => $e->getMessage() . ' - ' . print_r($metaValue, true)] |
|
297 | + ['template' => $metaValue, 'error' => $e->getMessage().' - '.print_r($metaValue, true)] |
|
298 | 298 | ); |
299 | 299 | Craft::error($metaValue, __METHOD__); |
300 | 300 | Craft::$app->getErrorHandler()->logException($e); |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | // Handle being passed in an object |
314 | 314 | if (is_object($metaValue)) { |
315 | 315 | if ($metaValue instanceof Markup) { |
316 | - return trim(html_entity_decode((string)$metaValue, ENT_NOQUOTES, 'UTF-8')); |
|
316 | + return trim(html_entity_decode((string) $metaValue, ENT_NOQUOTES, 'UTF-8')); |
|
317 | 317 | } |
318 | 318 | if ($metaValue instanceof Asset) { |
319 | 319 | /** @var Asset $metaValue */ |
@@ -19,11 +19,11 @@ |
||
19 | 19 | */ |
20 | 20 | |
21 | 21 | return [ |
22 | - MetaTitleContainer::CONTAINER_TYPE . TitleService::GENERAL_HANDLE => [ |
|
22 | + MetaTitleContainer::CONTAINER_TYPE.TitleService::GENERAL_HANDLE => [ |
|
23 | 23 | 'name' => 'General', |
24 | 24 | 'description' => 'Meta Title Tag', |
25 | 25 | 'handle' => TitleService::GENERAL_HANDLE, |
26 | - 'class' => (string)MetaTitleContainer::class, |
|
26 | + 'class' => (string) MetaTitleContainer::class, |
|
27 | 27 | 'include' => true, |
28 | 28 | 'dependencies' => [ |
29 | 29 | ], |
@@ -19,11 +19,11 @@ |
||
19 | 19 | */ |
20 | 20 | |
21 | 21 | return [ |
22 | - MetaJsonLdContainer::CONTAINER_TYPE . JsonLdService::GENERAL_HANDLE => [ |
|
22 | + MetaJsonLdContainer::CONTAINER_TYPE.JsonLdService::GENERAL_HANDLE => [ |
|
23 | 23 | 'name' => 'General', |
24 | 24 | 'description' => 'JsonLd Tags', |
25 | 25 | 'handle' => JsonLdService::GENERAL_HANDLE, |
26 | - 'class' => (string)MetaJsonLdContainer::class, |
|
26 | + 'class' => (string) MetaJsonLdContainer::class, |
|
27 | 27 | 'include' => true, |
28 | 28 | 'dependencies' => [ |
29 | 29 | ], |
@@ -21,11 +21,11 @@ |
||
21 | 21 | */ |
22 | 22 | |
23 | 23 | return [ |
24 | - MetaLinkContainer::CONTAINER_TYPE . LinkService::GENERAL_HANDLE => [ |
|
24 | + MetaLinkContainer::CONTAINER_TYPE.LinkService::GENERAL_HANDLE => [ |
|
25 | 25 | 'name' => 'General', |
26 | 26 | 'description' => 'Link Tags', |
27 | 27 | 'handle' => LinkService::GENERAL_HANDLE, |
28 | - 'class' => (string)MetaLinkContainer::class, |
|
28 | + 'class' => (string) MetaLinkContainer::class, |
|
29 | 29 | 'include' => true, |
30 | 30 | 'dependencies' => [ |
31 | 31 | ], |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | $baseUrl = UrlHelper::hostInfo(UrlHelper::siteUrl($path)); |
66 | 66 | |
67 | - return rtrim($baseUrl, '/') . '/' . ltrim($path, '/'); |
|
67 | + return rtrim($baseUrl, '/').'/'.ltrim($path, '/'); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | $metaSiteVars = Seomatic::$plugin->metaContainers->metaSiteVars; |
109 | 109 | if ($metaSiteVars && !empty($metaSiteVars->siteLinksQueryInput)) { |
110 | - $result = 'required name=' . $metaSiteVars->siteLinksQueryInput; |
|
110 | + $result = 'required name='.$metaSiteVars->siteLinksQueryInput; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | return $result; |
@@ -568,8 +568,8 @@ discard block |
||
568 | 568 | */ |
569 | 569 | public function isInherited(InheritableSettingsModel $settingCollection, $settingName) |
570 | 570 | { |
571 | - $explicitInherit = array_key_exists($settingName, (array)$settingCollection->inherited); |
|
572 | - $explicitOverride = array_key_exists($settingName, (array)$settingCollection->overrides); |
|
571 | + $explicitInherit = array_key_exists($settingName, (array) $settingCollection->inherited); |
|
572 | + $explicitOverride = array_key_exists($settingName, (array) $settingCollection->overrides); |
|
573 | 573 | |
574 | 574 | if ($explicitInherit || $explicitOverride) { |
575 | 575 | return $explicitInherit && !$explicitOverride; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function add($metaItem, string $handle = self::GENERAL_HANDLE) |
67 | 67 | { |
68 | - $key = MetaTitleContainer::CONTAINER_TYPE . $handle; |
|
68 | + $key = MetaTitleContainer::CONTAINER_TYPE.$handle; |
|
69 | 69 | Seomatic::$plugin->metaContainers->addToMetaContainer($metaItem, $key); |
70 | 70 | |
71 | 71 | /** @var MetaTitle $metaItem */ |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function container(string $handle = self::GENERAL_HANDLE) |
91 | 91 | { |
92 | - $key = MetaTitleContainer::CONTAINER_TYPE . $handle; |
|
92 | + $key = MetaTitleContainer::CONTAINER_TYPE.$handle; |
|
93 | 93 | |
94 | 94 | return Seomatic::$plugin->metaContainers->getMetaContainer($key); |
95 | 95 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function add($metaItem, string $handle = self::GENERAL_HANDLE) |
78 | 78 | { |
79 | - $key = MetaTagContainer::CONTAINER_TYPE . $handle; |
|
79 | + $key = MetaTagContainer::CONTAINER_TYPE.$handle; |
|
80 | 80 | Seomatic::$plugin->metaContainers->addToMetaContainer($metaItem, $key); |
81 | 81 | |
82 | 82 | /** @var MetaTag $metaItem */ |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function container(string $handle = self::GENERAL_HANDLE) |
102 | 102 | { |
103 | - $key = MetaTagContainer::CONTAINER_TYPE . $handle; |
|
103 | + $key = MetaTagContainer::CONTAINER_TYPE.$handle; |
|
104 | 104 | |
105 | 105 | return Seomatic::$plugin->metaContainers->getMetaContainer($key); |
106 | 106 | } |