@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | // Get the page number of this request |
178 | 178 | $request = Craft::$app->getRequest(); |
179 | 179 | if (!$request->isConsoleRequest) { |
180 | - $this->paginationPage = (string)$request->pageNum; |
|
180 | + $this->paginationPage = (string) $request->pageNum; |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 | |
@@ -253,10 +253,10 @@ discard block |
||
253 | 253 | $dependency = $this->containerDependency; |
254 | 254 | $uniqueKey = $dependency->tags[3] ?? self::GLOBALS_CACHE_KEY; |
255 | 255 | list($this->metaGlobalVars, $this->metaSiteVars) = Craft::$app->getCache()->getOrSet( |
256 | - self::GLOBALS_CACHE_KEY . $uniqueKey, |
|
256 | + self::GLOBALS_CACHE_KEY.$uniqueKey, |
|
257 | 257 | function() use ($uniqueKey) { |
258 | 258 | Craft::info( |
259 | - self::GLOBALS_CACHE_KEY . ' cache miss: ' . $uniqueKey, |
|
259 | + self::GLOBALS_CACHE_KEY.' cache miss: '.$uniqueKey, |
|
260 | 260 | __METHOD__ |
261 | 261 | ); |
262 | 262 | |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | ?? 1; |
377 | 377 | } |
378 | 378 | // Handle pagination |
379 | - $paginationPage = 'page' . $this->paginationPage; |
|
379 | + $paginationPage = 'page'.$this->paginationPage; |
|
380 | 380 | // Get the path for the current request |
381 | 381 | $request = Craft::$app->getRequest(); |
382 | 382 | $requestPath = '/'; |
@@ -392,21 +392,21 @@ discard block |
||
392 | 392 | } |
393 | 393 | } |
394 | 394 | // Get our cache key |
395 | - $cacheKey = $uri . $siteId . $paginationPage . $requestPath . $this->getAllowedUrlParams(); |
|
395 | + $cacheKey = $uri.$siteId.$paginationPage.$requestPath.$this->getAllowedUrlParams(); |
|
396 | 396 | // For requests with a status code of >= 400, use one cache key |
397 | 397 | if (!$request->isConsoleRequest) { |
398 | 398 | $response = Craft::$app->getResponse(); |
399 | 399 | if ($response->statusCode >= 400) { |
400 | - $cacheKey = $siteId . self::INVALID_RESPONSE_CACHE_KEY . $response->statusCode; |
|
400 | + $cacheKey = $siteId.self::INVALID_RESPONSE_CACHE_KEY.$response->statusCode; |
|
401 | 401 | } |
402 | 402 | } |
403 | 403 | // Load the meta containers |
404 | 404 | $dependency = new TagDependency([ |
405 | 405 | 'tags' => [ |
406 | 406 | self::GLOBAL_METACONTAINER_CACHE_TAG, |
407 | - self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId, |
|
408 | - self::METACONTAINER_CACHE_TAG . $uri . $siteId, |
|
409 | - self::METACONTAINER_CACHE_TAG . $cacheKey, |
|
407 | + self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId, |
|
408 | + self::METACONTAINER_CACHE_TAG.$uri.$siteId, |
|
409 | + self::METACONTAINER_CACHE_TAG.$cacheKey, |
|
410 | 410 | ], |
411 | 411 | ]); |
412 | 412 | $this->containerDependency = $dependency; |
@@ -423,10 +423,10 @@ discard block |
||
423 | 423 | } else { |
424 | 424 | $cache = Craft::$app->getCache(); |
425 | 425 | list($this->metaGlobalVars, $this->metaSiteVars, $this->metaSitemapVars, $this->metaContainers) = $cache->getOrSet( |
426 | - self::CACHE_KEY . $cacheKey, |
|
426 | + self::CACHE_KEY.$cacheKey, |
|
427 | 427 | function() use ($uri, $siteId) { |
428 | 428 | Craft::info( |
429 | - 'Meta container cache miss: ' . $uri . '/' . $siteId, |
|
429 | + 'Meta container cache miss: '.$uri.'/'.$siteId, |
|
430 | 430 | __METHOD__ |
431 | 431 | ); |
432 | 432 | $this->loadGlobalMetaContainers($siteId); |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | |
728 | 728 | // Handle re-creating the `mainEntityOfPage` so that the model injected into the |
729 | 729 | // templates has the appropriate attributes |
730 | - $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE . JsonLdService::GENERAL_HANDLE; |
|
730 | + $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE.JsonLdService::GENERAL_HANDLE; |
|
731 | 731 | $generalContainer = $this->metaContainers[$generalContainerKey]; |
732 | 732 | if (($generalContainer !== null) && !empty($generalContainer->data['mainEntityOfPage'])) { |
733 | 733 | /** @var MetaJsonLd $jsonLdModel */ |
@@ -987,10 +987,10 @@ discard block |
||
987 | 987 | $cache = Craft::$app->getCache(); |
988 | 988 | TagDependency::invalidate( |
989 | 989 | $cache, |
990 | - self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId |
|
990 | + self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId |
|
991 | 991 | ); |
992 | 992 | Craft::info( |
993 | - 'Meta bundle cache cleared: ' . $metaBundleSourceId . ' / ' . $metaBundleSourceType . ' / ' . $siteId, |
|
993 | + 'Meta bundle cache cleared: '.$metaBundleSourceId.' / '.$metaBundleSourceType.' / '.$siteId, |
|
994 | 994 | __METHOD__ |
995 | 995 | ); |
996 | 996 | // Trigger an event to let other plugins/modules know we've cleared our caches |
@@ -1017,9 +1017,9 @@ discard block |
||
1017 | 1017 | if ($siteId === null) { |
1018 | 1018 | $siteId = Craft::$app->getSites()->currentSite->id ?? 1; |
1019 | 1019 | } |
1020 | - TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG . $uri . $siteId); |
|
1020 | + TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG.$uri.$siteId); |
|
1021 | 1021 | Craft::info( |
1022 | - 'Meta container cache cleared: ' . $uri . ' / ' . $siteId, |
|
1022 | + 'Meta container cache cleared: '.$uri.' / '.$siteId, |
|
1023 | 1023 | __METHOD__ |
1024 | 1024 | ); |
1025 | 1025 | // Trigger an event to let other plugins/modules know we've cleared our caches |
@@ -388,7 +388,7 @@ |
||
388 | 388 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
389 | 389 | [ |
390 | 390 | 'sourceId' => $sourceModel->id, |
391 | - 'sourceName' => (string)$sourceModel->name, |
|
391 | + 'sourceName' => (string) $sourceModel->name, |
|
392 | 392 | 'sourceHandle' => $sourceModel->handle, |
393 | 393 | ] |
394 | 394 | ); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | ; |
226 | 226 | if ($metaBundle->sourceType === 'structure' |
227 | 227 | && !empty($metaBundle->metaSitemapVars->structureDepth)) { |
228 | - $query->level($metaBundle->metaSitemapVars->structureDepth . '<='); |
|
228 | + $query->level($metaBundle->metaSitemapVars->structureDepth.'<='); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | return $query; |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
396 | 396 | [ |
397 | 397 | 'sourceId' => $sourceModel->id, |
398 | - 'sourceName' => (string)$sourceModel->name, |
|
398 | + 'sourceName' => (string) $sourceModel->name, |
|
399 | 399 | 'sourceHandle' => $sourceModel->handle, |
400 | 400 | 'sourceType' => $sourceModel->type, |
401 | 401 | ] |
@@ -237,8 +237,8 @@ discard block |
||
237 | 237 | $query = Event::find() |
238 | 238 | ->setCalendar($metaBundle->sourceHandle) |
239 | 239 | ->setLoadOccurrences(false) |
240 | - ->siteId((int)$metaBundle->sourceSiteId) |
|
241 | - ->limit((int)$metaBundle->metaSitemapVars->sitemapLimit); |
|
240 | + ->siteId((int) $metaBundle->sourceSiteId) |
|
241 | + ->limit((int) $metaBundle->metaSitemapVars->sitemapLimit); |
|
242 | 242 | |
243 | 243 | return $query; |
244 | 244 | } |
@@ -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 | ] |
404 | 404 | ); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | ->limit($metaBundle->metaSitemapVars->sitemapLimit) |
221 | 221 | ; |
222 | 222 | if (!empty($metaBundle->metaSitemapVars->structureDepth)) { |
223 | - $query->level($metaBundle->metaSitemapVars->structureDepth . '<='); |
|
223 | + $query->level($metaBundle->metaSitemapVars->structureDepth.'<='); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | return $query; |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
380 | 380 | [ |
381 | 381 | 'sourceId' => $sourceModel->id, |
382 | - 'sourceName' => (string)$sourceModel->name, |
|
382 | + 'sourceName' => (string) $sourceModel->name, |
|
383 | 383 | 'sourceHandle' => $sourceModel->handle, |
384 | 384 | ] |
385 | 385 | ); |
@@ -77,7 +77,7 @@ |
||
77 | 77 | // Set the property |
78 | 78 | $value = $args[0]; |
79 | 79 | if (\is_object($value) && $value instanceof Markup) { |
80 | - $value = (string)$value; |
|
80 | + $value = (string) $value; |
|
81 | 81 | } |
82 | 82 | $property->setValue($this, $value); |
83 | 83 |
@@ -128,16 +128,16 @@ discard block |
||
128 | 128 | $dependency = new TagDependency([ |
129 | 129 | 'tags' => [ |
130 | 130 | self::GLOBAL_SITEMAP_CACHE_TAG, |
131 | - self::SITEMAP_CACHE_TAG . $handle . $siteId, |
|
131 | + self::SITEMAP_CACHE_TAG.$handle.$siteId, |
|
132 | 132 | ], |
133 | 133 | ]); |
134 | 134 | |
135 | - return $cache->getOrSet(self::CACHE_KEY . $groupId . self::CUSTOM_SCOPE . $handle . $siteId, function() use ( |
|
135 | + return $cache->getOrSet(self::CACHE_KEY.$groupId.self::CUSTOM_SCOPE.$handle.$siteId, function() use ( |
|
136 | 136 | $handle, |
137 | 137 | $siteId |
138 | 138 | ) { |
139 | 139 | Craft::info( |
140 | - 'Sitemap Custom cache miss: ' . $handle . '/' . $siteId, |
|
140 | + 'Sitemap Custom cache miss: '.$handle.'/'.$siteId, |
|
141 | 141 | __METHOD__ |
142 | 142 | ); |
143 | 143 | $lines = []; |
@@ -212,9 +212,9 @@ discard block |
||
212 | 212 | { |
213 | 213 | $handle = self::CUSTOM_HANDLE; |
214 | 214 | $cache = Craft::$app->getCache(); |
215 | - TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG . $handle . $siteId); |
|
215 | + TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG.$handle.$siteId); |
|
216 | 216 | Craft::info( |
217 | - 'Sitemap Custom cache cleared: ' . $handle, |
|
217 | + 'Sitemap Custom cache cleared: '.$handle, |
|
218 | 218 | __METHOD__ |
219 | 219 | ); |
220 | 220 | } |
@@ -51,16 +51,16 @@ |
||
51 | 51 | public function includeMetaData($dependency) |
52 | 52 | { |
53 | 53 | Craft::beginProfile('MetaJsonLdContainer::includeMetaData', __METHOD__); |
54 | - $uniqueKey = $this->handle . $dependency->tags[3] . '-v2'; |
|
54 | + $uniqueKey = $this->handle.$dependency->tags[3].'-v2'; |
|
55 | 55 | $cache = Craft::$app->getCache(); |
56 | 56 | if ($this->clearCache) { |
57 | 57 | TagDependency::invalidate($cache, $dependency->tags[3]); |
58 | 58 | } |
59 | 59 | [$jsonLd, $attrs] = $cache->getOrSet( |
60 | - self::CONTAINER_TYPE . $uniqueKey, |
|
60 | + self::CONTAINER_TYPE.$uniqueKey, |
|
61 | 61 | function() use ($uniqueKey) { |
62 | 62 | Craft::info( |
63 | - self::CONTAINER_TYPE . ' cache miss: ' . $uniqueKey, |
|
63 | + self::CONTAINER_TYPE.' cache miss: '.$uniqueKey, |
|
64 | 64 | __METHOD__ |
65 | 65 | ); |
66 | 66 |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function getFilename(int $groupId): string |
118 | 118 | { |
119 | - return 'sitemaps-' . $groupId . '-sitemap.xml'; |
|
119 | + return 'sitemaps-'.$groupId.'-sitemap.xml'; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | ], |
150 | 150 | ]); |
151 | 151 | |
152 | - return $cache->getOrSet(self::CACHE_KEY . $groupId . '.' . $siteId, function() use ($groupSiteIds, $siteId) { |
|
152 | + return $cache->getOrSet(self::CACHE_KEY.$groupId.'.'.$siteId, function() use ($groupSiteIds, $siteId) { |
|
153 | 153 | Craft::info( |
154 | 154 | 'Sitemap index cache miss', |
155 | 155 | __METHOD__ |