@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | 'name' => static::getName(), |
81 | 81 | 'fields' => self::class.'::getFieldDefinitions', |
82 | 82 | 'description' => 'This is the interface implemented by SEOmatic.', |
83 | - 'resolveType' => function (array $value) { |
|
83 | + 'resolveType' => function(array $value) { |
|
84 | 84 | return GqlEntityRegistry::getEntity(SeomaticGenerator::getName()); |
85 | 85 | }, |
86 | 86 | ])); |
@@ -119,27 +119,27 @@ discard block |
||
119 | 119 | 'name' => 'sitemaps', |
120 | 120 | 'args' => SitemapArguments::getArguments(), |
121 | 121 | 'type' => Type::listOf(FileContentsType::getType()), |
122 | - 'resolve' => SitemapResolver::class .'::getSitemaps' |
|
122 | + 'resolve' => SitemapResolver::class.'::getSitemaps' |
|
123 | 123 | ]; |
124 | 124 | |
125 | 125 | $fields['sitemapIndexes'] = [ |
126 | 126 | 'name' => 'sitemapIndexes', |
127 | 127 | 'args' => SitemapIndexArguments::getArguments(), |
128 | 128 | 'type' => Type::listOf(FileContentsType::getType()), |
129 | - 'resolve' => SitemapResolver::class .'::getSitemapIndexes' |
|
129 | + 'resolve' => SitemapResolver::class.'::getSitemapIndexes' |
|
130 | 130 | ]; |
131 | 131 | |
132 | 132 | $fields['sitemapStyles'] = [ |
133 | 133 | 'name' => 'sitemapStyles', |
134 | 134 | 'type' => FileContentsType::getType(), |
135 | - 'resolve' => SitemapResolver::class .'::getSitemapStyles' |
|
135 | + 'resolve' => SitemapResolver::class.'::getSitemapStyles' |
|
136 | 136 | ]; |
137 | 137 | |
138 | 138 | $fields['frontendTemplates'] = [ |
139 | 139 | 'name' => 'frontendTemplates', |
140 | 140 | 'args' => FrontendContainerArguments::getArguments(), |
141 | 141 | 'type' => Type::listOf(FileContentsType::getType()), |
142 | - 'resolve' => FrontendContainerResolver::class .'::getContainerFiles' |
|
142 | + 'resolve' => FrontendContainerResolver::class.'::getContainerFiles' |
|
143 | 143 | ]; |
144 | 144 | |
145 | 145 | return $fields; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | // Handle trailing slashes properly for generated URLs |
48 | 48 | $generalConfig = Craft::$app->getConfig()->getGeneral(); |
49 | 49 | if ($generalConfig->addTrailingSlashesToUrls && !preg_match('/\.[^\/]+$/', $url)) { |
50 | - $url = rtrim($url, '/') . '/'; |
|
50 | + $url = rtrim($url, '/').'/'; |
|
51 | 51 | } |
52 | 52 | if (!$generalConfig->addTrailingSlashesToUrls) { |
53 | 53 | $url = rtrim($url, '/'); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | // Handle trailing slashes properly for generated URLs |
125 | 125 | $generalConfig = Craft::$app->getConfig()->getGeneral(); |
126 | 126 | if ($generalConfig->addTrailingSlashesToUrls && !preg_match('/\.[^\/]+$/', $url)) { |
127 | - $url = rtrim($url, '/') . '/'; |
|
127 | + $url = rtrim($url, '/').'/'; |
|
128 | 128 | } |
129 | 129 | if (!$generalConfig->addTrailingSlashesToUrls) { |
130 | 130 | $url = rtrim($url, '/'); |
@@ -160,11 +160,11 @@ discard block |
||
160 | 160 | |
161 | 161 | if (filter_var($pathOrUrl, FILTER_VALIDATE_URL)) { |
162 | 162 | $url_parts = parse_url($pathOrUrl); |
163 | - $result['prefix'] = $url_parts['scheme'] . '://' . $url_parts['host']; |
|
163 | + $result['prefix'] = $url_parts['scheme'].'://'.$url_parts['host']; |
|
164 | 164 | $result['path'] = $url_parts['path'] ?? ''; |
165 | 165 | $result['suffix'] = ''; |
166 | - $result['suffix'] .= empty($url_parts['query']) ? '' : '?' . $url_parts['query']; |
|
167 | - $result['suffix'] .= empty($url_parts['fragment']) ? '' : '#' . $url_parts['fragment']; |
|
166 | + $result['suffix'] .= empty($url_parts['query']) ? '' : '?'.$url_parts['query']; |
|
167 | + $result['suffix'] .= empty($url_parts['fragment']) ? '' : '#'.$url_parts['fragment']; |
|
168 | 168 | } else { |
169 | 169 | $result['prefix'] = ''; |
170 | 170 | $result['path'] = $pathOrUrl; |
@@ -22,7 +22,7 @@ |
||
22 | 22 | 'name' => 'Frontend Templates', |
23 | 23 | 'description' => 'Templates that are rendered on the frontend', |
24 | 24 | 'handle' => FrontendTemplates::FRONTENDTEMPLATES_CONTAINER, |
25 | - 'class' => (string)FrontendTemplateContainer::class, |
|
25 | + 'class' => (string) FrontendTemplateContainer::class, |
|
26 | 26 | 'include' => true, |
27 | 27 | 'data' => [ |
28 | 28 | FrontendTemplates::HUMANS_TXT_HANDLE => [ |
@@ -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 | ], |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | */ |
21 | 21 | |
22 | 22 | return [ |
23 | - MetaTagContainer::CONTAINER_TYPE . TagService::GENERAL_HANDLE => [ |
|
23 | + MetaTagContainer::CONTAINER_TYPE.TagService::GENERAL_HANDLE => [ |
|
24 | 24 | 'name' => 'General', |
25 | 25 | 'description' => 'General Meta Tags', |
26 | 26 | 'handle' => TagService::GENERAL_HANDLE, |
27 | - 'class' => (string)MetaTagContainer::class, |
|
27 | + 'class' => (string) MetaTagContainer::class, |
|
28 | 28 | 'include' => true, |
29 | 29 | 'dependencies' => [ |
30 | 30 | ], |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | ], |
77 | 77 | ], |
78 | 78 | ], |
79 | - MetaTagContainer::CONTAINER_TYPE . TagService::FACEBOOK_HANDLE => [ |
|
79 | + MetaTagContainer::CONTAINER_TYPE.TagService::FACEBOOK_HANDLE => [ |
|
80 | 80 | 'name' => 'Facebook', |
81 | 81 | 'description' => 'Facebook OpenGraph Meta Tags', |
82 | 82 | 'handle' => TagService::FACEBOOK_HANDLE, |
83 | - 'class' => (string)MetaTagContainer::class, |
|
83 | + 'class' => (string) MetaTagContainer::class, |
|
84 | 84 | 'include' => true, |
85 | 85 | 'dependencies' => [ |
86 | 86 | ], |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | ], |
207 | 207 | ], |
208 | 208 | ], |
209 | - MetaTagContainer::CONTAINER_TYPE . TagService::TWITTER_HANDLE => [ |
|
209 | + MetaTagContainer::CONTAINER_TYPE.TagService::TWITTER_HANDLE => [ |
|
210 | 210 | 'name' => 'Twitter', |
211 | 211 | 'description' => 'Twitter Card Meta Tags', |
212 | 212 | 'handle' => TagService::TWITTER_HANDLE, |
213 | 213 | 'include' => true, |
214 | - 'class' => (string)MetaTagContainer::class, |
|
214 | + 'class' => (string) MetaTagContainer::class, |
|
215 | 215 | 'dependencies' => [ |
216 | 216 | Dependency::SITE_DEPENDENCY => ['twitterHandle'], |
217 | 217 | ], |
@@ -290,11 +290,11 @@ discard block |
||
290 | 290 | ], |
291 | 291 | ], |
292 | 292 | ], |
293 | - MetaTagContainer::CONTAINER_TYPE . TagService::MISC_HANDLE => [ |
|
293 | + MetaTagContainer::CONTAINER_TYPE.TagService::MISC_HANDLE => [ |
|
294 | 294 | 'name' => 'Miscellaneous', |
295 | 295 | 'description' => 'Miscellaneous Meta Tags', |
296 | 296 | 'handle' => TagService::MISC_HANDLE, |
297 | - 'class' => (string)MetaTagContainer::class, |
|
297 | + 'class' => (string) MetaTagContainer::class, |
|
298 | 298 | 'include' => true, |
299 | 299 | 'dependencies' => [ |
300 | 300 | ], |