@@ -54,16 +54,16 @@ |
||
54 | 54 | public function includeMetaData($dependency) |
55 | 55 | { |
56 | 56 | Craft::beginProfile('MetaScriptContainer::includeMetaData', __METHOD__); |
57 | - $uniqueKey = $this->handle . $dependency->tags[3] . $this->dataLayerHash(); |
|
57 | + $uniqueKey = $this->handle.$dependency->tags[3].$this->dataLayerHash(); |
|
58 | 58 | $cache = Craft::$app->getCache(); |
59 | 59 | if ($this->clearCache) { |
60 | 60 | TagDependency::invalidate($cache, $dependency->tags[3]); |
61 | 61 | } |
62 | 62 | $tagData = $cache->getOrSet( |
63 | - self::CONTAINER_TYPE . $uniqueKey, |
|
64 | - function () use ($uniqueKey) { |
|
63 | + self::CONTAINER_TYPE.$uniqueKey, |
|
64 | + function() use ($uniqueKey) { |
|
65 | 65 | Craft::info( |
66 | - self::CONTAINER_TYPE . ' cache miss: ' . $uniqueKey, |
|
66 | + self::CONTAINER_TYPE.' cache miss: '.$uniqueKey, |
|
67 | 67 | __METHOD__ |
68 | 68 | ); |
69 | 69 | $tagData = []; |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | // Get the page number of this request |
161 | 161 | $request = Craft::$app->getRequest(); |
162 | 162 | if (!$request->isConsoleRequest) { |
163 | - $this->paginationPage = (string)$request->pageNum; |
|
163 | + $this->paginationPage = (string) $request->pageNum; |
|
164 | 164 | } |
165 | 165 | } |
166 | 166 | |
@@ -222,10 +222,10 @@ discard block |
||
222 | 222 | $dependency = $this->containerDependency; |
223 | 223 | $uniqueKey = $dependency->tags[3] ?? self::GLOBALS_CACHE_KEY; |
224 | 224 | list($this->metaGlobalVars, $this->metaSiteVars) = Craft::$app->getCache()->getOrSet( |
225 | - self::GLOBALS_CACHE_KEY . $uniqueKey, |
|
226 | - function () use ($uniqueKey) { |
|
225 | + self::GLOBALS_CACHE_KEY.$uniqueKey, |
|
226 | + function() use ($uniqueKey) { |
|
227 | 227 | Craft::info( |
228 | - self::GLOBALS_CACHE_KEY . ' cache miss: ' . $uniqueKey, |
|
228 | + self::GLOBALS_CACHE_KEY.' cache miss: '.$uniqueKey, |
|
229 | 229 | __METHOD__ |
230 | 230 | ); |
231 | 231 | |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | ?? 1; |
347 | 347 | } |
348 | 348 | // Handle pagination |
349 | - $paginationPage = 'page' . $this->paginationPage; |
|
349 | + $paginationPage = 'page'.$this->paginationPage; |
|
350 | 350 | // Get the path for the current request |
351 | 351 | $request = Craft::$app->getRequest(); |
352 | 352 | $requestPath = '/'; |
@@ -362,21 +362,21 @@ discard block |
||
362 | 362 | } |
363 | 363 | } |
364 | 364 | // Get our cache key |
365 | - $cacheKey = $uri . $siteId . $paginationPage . $requestPath . $this->getAllowedUrlParams(); |
|
365 | + $cacheKey = $uri.$siteId.$paginationPage.$requestPath.$this->getAllowedUrlParams(); |
|
366 | 366 | // For requests with a status code of >= 400, use one cache key |
367 | 367 | if (!$request->isConsoleRequest) { |
368 | 368 | $response = Craft::$app->getResponse(); |
369 | 369 | if ($response->statusCode >= 400) { |
370 | - $cacheKey = $siteId . self::INVALID_RESPONSE_CACHE_KEY . $response->statusCode; |
|
370 | + $cacheKey = $siteId.self::INVALID_RESPONSE_CACHE_KEY.$response->statusCode; |
|
371 | 371 | } |
372 | 372 | } |
373 | 373 | // Load the meta containers |
374 | 374 | $dependency = new TagDependency([ |
375 | 375 | 'tags' => [ |
376 | 376 | self::GLOBAL_METACONTAINER_CACHE_TAG, |
377 | - self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId, |
|
378 | - self::METACONTAINER_CACHE_TAG . $uri . $siteId, |
|
379 | - self::METACONTAINER_CACHE_TAG . $cacheKey, |
|
377 | + self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId, |
|
378 | + self::METACONTAINER_CACHE_TAG.$uri.$siteId, |
|
379 | + self::METACONTAINER_CACHE_TAG.$cacheKey, |
|
380 | 380 | ], |
381 | 381 | ]); |
382 | 382 | $this->containerDependency = $dependency; |
@@ -392,10 +392,10 @@ discard block |
||
392 | 392 | } else { |
393 | 393 | $cache = Craft::$app->getCache(); |
394 | 394 | list($this->metaGlobalVars, $this->metaSiteVars, $this->metaSitemapVars, $this->metaContainers) = $cache->getOrSet( |
395 | - self::CACHE_KEY . $cacheKey, |
|
396 | - function () use ($uri, $siteId) { |
|
395 | + self::CACHE_KEY.$cacheKey, |
|
396 | + function() use ($uri, $siteId) { |
|
397 | 397 | Craft::info( |
398 | - 'Meta container cache miss: ' . $uri . '/' . $siteId, |
|
398 | + 'Meta container cache miss: '.$uri.'/'.$siteId, |
|
399 | 399 | __METHOD__ |
400 | 400 | ); |
401 | 401 | $this->loadGlobalMetaContainers($siteId); |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | |
665 | 665 | // Handle re-creating the `mainEntityOfPage` so that the model injected into the |
666 | 666 | // templates has the appropriate attributes |
667 | - $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE . JsonLdService::GENERAL_HANDLE; |
|
667 | + $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE.JsonLdService::GENERAL_HANDLE; |
|
668 | 668 | $generalContainer = $this->metaContainers[$generalContainerKey]; |
669 | 669 | if (($generalContainer !== null) && !empty($generalContainer->data['mainEntityOfPage'])) { |
670 | 670 | /** @var MetaJsonLd $jsonLdModel */ |
@@ -916,10 +916,10 @@ discard block |
||
916 | 916 | $cache = Craft::$app->getCache(); |
917 | 917 | TagDependency::invalidate( |
918 | 918 | $cache, |
919 | - self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId |
|
919 | + self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId |
|
920 | 920 | ); |
921 | 921 | Craft::info( |
922 | - 'Meta bundle cache cleared: ' . $metaBundleSourceId . ' / ' . $metaBundleSourceType . ' / ' . $siteId, |
|
922 | + 'Meta bundle cache cleared: '.$metaBundleSourceId.' / '.$metaBundleSourceType.' / '.$siteId, |
|
923 | 923 | __METHOD__ |
924 | 924 | ); |
925 | 925 | // Trigger an event to let other plugins/modules know we've cleared our caches |
@@ -946,9 +946,9 @@ discard block |
||
946 | 946 | if ($siteId === null) { |
947 | 947 | $siteId = Craft::$app->getSites()->currentSite->id ?? 1; |
948 | 948 | } |
949 | - TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG . $uri . $siteId); |
|
949 | + TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG.$uri.$siteId); |
|
950 | 950 | Craft::info( |
951 | - 'Meta container cache cleared: ' . $uri . ' / ' . $siteId, |
|
951 | + 'Meta container cache cleared: '.$uri.' / '.$siteId, |
|
952 | 952 | __METHOD__ |
953 | 953 | ); |
954 | 954 | // Trigger an event to let other plugins/modules know we've cleared our caches |
@@ -50,16 +50,16 @@ |
||
50 | 50 | public function includeMetaData($dependency) |
51 | 51 | { |
52 | 52 | Craft::beginProfile('MetaJsonLdContainer::includeMetaData', __METHOD__); |
53 | - $uniqueKey = $this->handle . $dependency->tags[3] . '-v2'; |
|
53 | + $uniqueKey = $this->handle.$dependency->tags[3].'-v2'; |
|
54 | 54 | $cache = Craft::$app->getCache(); |
55 | 55 | if ($this->clearCache) { |
56 | 56 | TagDependency::invalidate($cache, $dependency->tags[3]); |
57 | 57 | } |
58 | 58 | [$jsonLd, $attrs] = $cache->getOrSet( |
59 | - self::CONTAINER_TYPE . $uniqueKey, |
|
60 | - function () use ($uniqueKey) { |
|
59 | + self::CONTAINER_TYPE.$uniqueKey, |
|
60 | + function() use ($uniqueKey) { |
|
61 | 61 | Craft::info( |
62 | - self::CONTAINER_TYPE . ' cache miss: ' . $uniqueKey, |
|
62 | + self::CONTAINER_TYPE.' cache miss: '.$uniqueKey, |
|
63 | 63 | __METHOD__ |
64 | 64 | ); |
65 | 65 | $tagData = []; |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | self::$cacheDuration = self::$devMode |
271 | 271 | ? self::DEVMODE_CACHE_DURATION |
272 | 272 | : self::$settings->metaCacheDuration ?? null; |
273 | - self::$cacheDuration = self::$cacheDuration === null ? null : (int)self::$cacheDuration; |
|
273 | + self::$cacheDuration = self::$cacheDuration === null ? null : (int) self::$cacheDuration; |
|
274 | 274 | self::$environment = EnvironmentHelper::determineEnvironment(); |
275 | 275 | MetaValueHelper::cache(); |
276 | 276 | // Version helpers |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | Event::on( |
346 | 346 | Plugins::class, |
347 | 347 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
348 | - function (PluginEvent $event) { |
|
348 | + function(PluginEvent $event) { |
|
349 | 349 | if ($event->plugin === $this) { |
350 | 350 | // Invalidate our caches after we've been installed |
351 | 351 | $this->clearAllCaches(); |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | Event::on( |
367 | 367 | ClearCaches::class, |
368 | 368 | ClearCaches::EVENT_REGISTER_CACHE_OPTIONS, |
369 | - function (RegisterCacheOptionsEvent $event) { |
|
369 | + function(RegisterCacheOptionsEvent $event) { |
|
370 | 370 | Craft::debug( |
371 | 371 | 'ClearCaches::EVENT_REGISTER_CACHE_OPTIONS', |
372 | 372 | __METHOD__ |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | Event::on( |
383 | 383 | Plugins::class, |
384 | 384 | Plugins::EVENT_BEFORE_SAVE_PLUGIN_SETTINGS, |
385 | - function (PluginEvent $event) { |
|
385 | + function(PluginEvent $event) { |
|
386 | 386 | if ($event->plugin === $this && !Craft::$app->getDb()->getSupportsMb4()) { |
387 | 387 | // For all the emojis |
388 | 388 | $settingsModel = $this->getSettings(); |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | Event::on( |
436 | 436 | Plugins::class, |
437 | 437 | Plugins::EVENT_AFTER_LOAD_PLUGINS, |
438 | - function () { |
|
438 | + function() { |
|
439 | 439 | // Delay registering SEO Elements to give other plugins a chance to load first |
440 | 440 | $this->seoElements->getAllSeoElementTypes(false); |
441 | 441 | // Delay installing GQL handlers to give other plugins a chance to register their own first |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | Event::on( |
457 | 457 | Fields::class, |
458 | 458 | Fields::EVENT_REGISTER_FIELD_TYPES, |
459 | - function (RegisterComponentTypesEvent $event) { |
|
459 | + function(RegisterComponentTypesEvent $event) { |
|
460 | 460 | $event->types[] = SeoSettingsField::class; |
461 | 461 | $event->types[] = Seomatic_MetaField::class; |
462 | 462 | } |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | Event::on( |
466 | 466 | Elements::class, |
467 | 467 | Elements::EVENT_AFTER_SAVE_ELEMENT, |
468 | - function (ElementEvent $event) { |
|
468 | + function(ElementEvent $event) { |
|
469 | 469 | Craft::debug( |
470 | 470 | 'Elements::EVENT_AFTER_SAVE_ELEMENT', |
471 | 471 | __METHOD__ |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | Event::on( |
486 | 486 | Elements::class, |
487 | 487 | Elements::EVENT_AFTER_DELETE_ELEMENT, |
488 | - function (ElementEvent $event) { |
|
488 | + function(ElementEvent $event) { |
|
489 | 489 | Craft::debug( |
490 | 490 | 'Elements::EVENT_AFTER_DELETE_ELEMENT', |
491 | 491 | __METHOD__ |
@@ -504,19 +504,19 @@ discard block |
||
504 | 504 | Event::on( |
505 | 505 | Entry::class, |
506 | 506 | Entry::EVENT_REGISTER_PREVIEW_TARGETS, |
507 | - function (RegisterPreviewTargetsEvent $e) { |
|
507 | + function(RegisterPreviewTargetsEvent $e) { |
|
508 | 508 | /** @var Element $element */ |
509 | 509 | $element = $e->sender; |
510 | 510 | if ($element->uri !== null) { |
511 | 511 | $e->previewTargets[] = [ |
512 | - 'label' => ' |