@@ -56,7 +56,7 @@ |
||
| 56 | 56 | } |
| 57 | 57 | $tagData = $cache->getOrSet( |
| 58 | 58 | self::CONTAINER_TYPE.$uniqueKey, |
| 59 | - function () use ($uniqueKey) { |
|
| 59 | + function() use ($uniqueKey) { |
|
| 60 | 60 | Craft::info( |
| 61 | 61 | self::CONTAINER_TYPE.' cache miss: '.$uniqueKey, |
| 62 | 62 | __METHOD__ |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | // Get the page number of this request |
| 158 | 158 | $request = Craft::$app->getRequest(); |
| 159 | 159 | if (!$request->isConsoleRequest) { |
| 160 | - $this->paginationPage = (string)$request->pageNum; |
|
| 160 | + $this->paginationPage = (string) $request->pageNum; |
|
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | |
@@ -173,10 +173,10 @@ discard block |
||
| 173 | 173 | $uniqueKey = $dependency->tags[3] ?? self::GLOBALS_CACHE_KEY; |
| 174 | 174 | $uniqueKey .= $bodyPosition; |
| 175 | 175 | $scriptData = Craft::$app->getCache()->getOrSet( |
| 176 | - self::GLOBALS_CACHE_KEY . $uniqueKey, |
|
| 177 | - function () use ($uniqueKey, $bodyPosition) { |
|
| 176 | + self::GLOBALS_CACHE_KEY.$uniqueKey, |
|
| 177 | + function() use ($uniqueKey, $bodyPosition) { |
|
| 178 | 178 | Craft::info( |
| 179 | - self::SCRIPTS_CACHE_KEY . ' cache miss: ' . $uniqueKey, |
|
| 179 | + self::SCRIPTS_CACHE_KEY.' cache miss: '.$uniqueKey, |
|
| 180 | 180 | __METHOD__ |
| 181 | 181 | ); |
| 182 | 182 | $scriptData = []; |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | foreach ($scriptContainer->data as $metaScript) { |
| 189 | 189 | /** @var MetaScript $metaScript */ |
| 190 | 190 | if (!empty($metaScript->bodyTemplatePath) |
| 191 | - && ((int)$metaScript->bodyPosition === $bodyPosition)) { |
|
| 191 | + && ((int) $metaScript->bodyPosition === $bodyPosition)) { |
|
| 192 | 192 | $scriptData[] = $metaScript->renderBodyHtml(); |
| 193 | 193 | } |
| 194 | 194 | } |
@@ -268,10 +268,10 @@ discard block |
||
| 268 | 268 | $dependency = $this->containerDependency; |
| 269 | 269 | $uniqueKey = $dependency->tags[3] ?? self::GLOBALS_CACHE_KEY; |
| 270 | 270 | list($this->metaGlobalVars, $this->metaSiteVars) = Craft::$app->getCache()->getOrSet( |
| 271 | - self::GLOBALS_CACHE_KEY . $uniqueKey, |
|
| 272 | - function () use ($uniqueKey) { |
|
| 271 | + self::GLOBALS_CACHE_KEY.$uniqueKey, |
|
| 272 | + function() use ($uniqueKey) { |
|
| 273 | 273 | Craft::info( |
| 274 | - self::GLOBALS_CACHE_KEY . ' cache miss: ' . $uniqueKey, |
|
| 274 | + self::GLOBALS_CACHE_KEY.' cache miss: '.$uniqueKey, |
|
| 275 | 275 | __METHOD__ |
| 276 | 276 | ); |
| 277 | 277 | |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | ?? 1; |
| 393 | 393 | } |
| 394 | 394 | // Handle pagination |
| 395 | - $paginationPage = 'page' . $this->paginationPage; |
|
| 395 | + $paginationPage = 'page'.$this->paginationPage; |
|
| 396 | 396 | // Get the path for the current request |
| 397 | 397 | $request = Craft::$app->getRequest(); |
| 398 | 398 | $requestPath = '/'; |
@@ -408,21 +408,21 @@ discard block |
||
| 408 | 408 | } |
| 409 | 409 | } |
| 410 | 410 | // Get our cache key |
| 411 | - $cacheKey = $uri . $siteId . $paginationPage . $requestPath . $this->getAllowedUrlParams(); |
|
| 411 | + $cacheKey = $uri.$siteId.$paginationPage.$requestPath.$this->getAllowedUrlParams(); |
|
| 412 | 412 | // For requests with a status code of >= 400, use one cache key |
| 413 | 413 | if (!$request->isConsoleRequest) { |
| 414 | 414 | $response = Craft::$app->getResponse(); |
| 415 | 415 | if ($response->statusCode >= 400) { |
| 416 | - $cacheKey = $siteId . self::INVALID_RESPONSE_CACHE_KEY . $response->statusCode; |
|
| 416 | + $cacheKey = $siteId.self::INVALID_RESPONSE_CACHE_KEY.$response->statusCode; |
|
| 417 | 417 | } |
| 418 | 418 | } |
| 419 | 419 | // Load the meta containers |
| 420 | 420 | $dependency = new TagDependency([ |
| 421 | 421 | 'tags' => [ |
| 422 | 422 | self::GLOBAL_METACONTAINER_CACHE_TAG, |
| 423 | - self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId, |
|
| 424 | - self::METACONTAINER_CACHE_TAG . $uri . $siteId, |
|
| 425 | - self::METACONTAINER_CACHE_TAG . $cacheKey, |
|
| 423 | + self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId, |
|
| 424 | + self::METACONTAINER_CACHE_TAG.$uri.$siteId, |
|
| 425 | + self::METACONTAINER_CACHE_TAG.$cacheKey, |
|
| 426 | 426 | ], |
| 427 | 427 | ]); |
| 428 | 428 | $this->containerDependency = $dependency; |
@@ -438,10 +438,10 @@ discard block |
||
| 438 | 438 | } else { |
| 439 | 439 | $cache = Craft::$app->getCache(); |
| 440 | 440 | list($this->metaGlobalVars, $this->metaSiteVars, $this->metaSitemapVars, $this->metaContainers) = $cache->getOrSet( |
| 441 | - self::CACHE_KEY . $cacheKey, |
|
| 442 | - function () use ($uri, $siteId) { |
|
| 441 | + self::CACHE_KEY.$cacheKey, |
|
| 442 | + function() use ($uri, $siteId) { |
|
| 443 | 443 | Craft::info( |
| 444 | - 'Meta container cache miss: ' . $uri . '/' . $siteId, |
|
| 444 | + 'Meta container cache miss: '.$uri.'/'.$siteId, |
|
| 445 | 445 | __METHOD__ |
| 446 | 446 | ); |
| 447 | 447 | $this->loadGlobalMetaContainers($siteId); |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | |
| 711 | 711 | // Handle re-creating the `mainEntityOfPage` so that the model injected into the |
| 712 | 712 | // templates has the appropriate attributes |
| 713 | - $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE . JsonLdService::GENERAL_HANDLE; |
|
| 713 | + $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE.JsonLdService::GENERAL_HANDLE; |
|
| 714 | 714 | $generalContainer = $this->metaContainers[$generalContainerKey]; |
| 715 | 715 | if (($generalContainer !== null) && !empty($generalContainer->data['mainEntityOfPage'])) { |
| 716 | 716 | /** @var MetaJsonLd $jsonLdModel */ |
@@ -962,10 +962,10 @@ discard block |
||
| 962 | 962 | $cache = Craft::$app->getCache(); |
| 963 | 963 | TagDependency::invalidate( |
| 964 | 964 | $cache, |
| 965 | - self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId |
|
| 965 | + self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId |
|
| 966 | 966 | ); |
| 967 | 967 | Craft::info( |
| 968 | - 'Meta bundle cache cleared: ' . $metaBundleSourceId . ' / ' . $metaBundleSourceType . ' / ' . $siteId, |
|
| 968 | + 'Meta bundle cache cleared: '.$metaBundleSourceId.' / '.$metaBundleSourceType.' / '.$siteId, |
|
| 969 | 969 | __METHOD__ |
| 970 | 970 | ); |
| 971 | 971 | // Trigger an event to let other plugins/modules know we've cleared our caches |
@@ -992,9 +992,9 @@ discard block |
||
| 992 | 992 | if ($siteId === null) { |
| 993 | 993 | $siteId = Craft::$app->getSites()->currentSite->id ?? 1; |
| 994 | 994 | } |
| 995 | - TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG . $uri . $siteId); |
|
| 995 | + TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG.$uri.$siteId); |
|
| 996 | 996 | Craft::info( |
| 997 | - 'Meta container cache cleared: ' . $uri . ' / ' . $siteId, |
|
| 997 | + 'Meta container cache cleared: '.$uri.' / '.$siteId, |
|
| 998 | 998 | __METHOD__ |
| 999 | 999 | ); |
| 1000 | 1000 | // Trigger an event to let other plugins/modules know we've cleared our caches |
@@ -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' => ' |
|