@@ -20,11 +20,11 @@ |
||
20 | 20 | */ |
21 | 21 | |
22 | 22 | return [ |
23 | - MetaScriptContainer::CONTAINER_TYPE . ScriptService::GENERAL_HANDLE => [ |
|
23 | + MetaScriptContainer::CONTAINER_TYPE.ScriptService::GENERAL_HANDLE => [ |
|
24 | 24 | 'name' => 'General', |
25 | 25 | 'description' => 'Script Tags', |
26 | 26 | 'handle' => ScriptService::GENERAL_HANDLE, |
27 | - 'class' => (string)MetaScriptContainer::class, |
|
27 | + 'class' => (string) MetaScriptContainer::class, |
|
28 | 28 | 'include' => true, |
29 | 29 | 'dependencies' => [ |
30 | 30 | ], |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | Event::on( |
107 | 107 | ProductTypes::class, |
108 | 108 | ProductTypes::EVENT_AFTER_SAVE_PRODUCTTYPE, |
109 | - function (ProductTypeEvent $event) { |
|
109 | + function(ProductTypeEvent $event) { |
|
110 | 110 | Craft::debug( |
111 | 111 | 'ProductTypes::EVENT_AFTER_SAVE_PRODUCTTYPE', |
112 | 112 | __METHOD__ |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | Event::on( |
122 | 122 | ProductTypes::class, |
123 | 123 | ProductTypes::EVENT_AFTER_SAVE_PRODUCTTYPE, |
124 | - static function (ProductTypeEvent $event) { |
|
124 | + static function(ProductTypeEvent $event) { |
|
125 | 125 | Craft::debug( |
126 | 126 | 'ProductTypes::EVENT_AFTER_SAVE_PRODUCTTYPE', |
127 | 127 | __METHOD__ |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | // Commerce Product Types sidebar |
185 | 185 | $commerce = CommercePlugin::getInstance(); |
186 | 186 | if ($commerce !== null) { |
187 | - Seomatic::$view->hook('cp.commerce.product.edit.details', static function (&$context) { |
|
187 | + Seomatic::$view->hook('cp.commerce.product.edit.details', static function(&$context) { |
|
188 | 188 | $html = ''; |
189 | 189 | Seomatic::$view->registerAssetBundle(SeomaticAsset::class); |
190 | 190 | /** @var $product Product */ |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | Event::on( |
212 | 212 | Product::class, |
213 | 213 | Product::EVENT_DEFINE_SIDEBAR_HTML, |
214 | - static function (DefineHtmlEvent $event) { |
|
214 | + static function(DefineHtmlEvent $event) { |
|
215 | 215 | Craft::debug( |
216 | 216 | 'Product::EVENT_DEFINE_SIDEBAR_HTML', |
217 | 217 | __METHOD__ |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
421 | 421 | [ |
422 | 422 | 'sourceId' => $sourceModel->id, |
423 | - 'sourceName' => (string)$sourceModel->name, |
|
423 | + 'sourceName' => (string) $sourceModel->name, |
|
424 | 424 | 'sourceHandle' => $sourceModel->handle, |
425 | 425 | ] |
426 | 426 | ); |
@@ -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); |
@@ -790,10 +790,10 @@ discard block |
||
790 | 790 | $cache = Craft::$app->getCache(); |
791 | 791 | TagDependency::invalidate( |
792 | 792 | $cache, |
793 | - self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId |
|
793 | + self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId |
|
794 | 794 | ); |
795 | 795 | Craft::info( |
796 | - 'Meta bundle cache cleared: ' . $metaBundleSourceId . ' / ' . $metaBundleSourceType . ' / ' . $siteId, |
|
796 | + 'Meta bundle cache cleared: '.$metaBundleSourceId.' / '.$metaBundleSourceType.' / '.$siteId, |
|
797 | 797 | __METHOD__ |
798 | 798 | ); |
799 | 799 | // Trigger an event to let other plugins/modules know we've cleared our caches |
@@ -820,9 +820,9 @@ discard block |
||
820 | 820 | if ($siteId === null) { |
821 | 821 | $siteId = Craft::$app->getSites()->currentSite->id ?? 1; |
822 | 822 | } |
823 | - TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG . $uri . $siteId); |
|
823 | + TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG.$uri.$siteId); |
|
824 | 824 | Craft::info( |
825 | - 'Meta container cache cleared: ' . $uri . ' / ' . $siteId, |
|
825 | + 'Meta container cache cleared: '.$uri.' / '.$siteId, |
|
826 | 826 | __METHOD__ |
827 | 827 | ); |
828 | 828 | // Trigger an event to let other plugins/modules know we've cleared our caches |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | |
940 | 940 | // Handle re-creating the `mainEntityOfPage` so that the model injected into the |
941 | 941 | // templates has the appropriate attributes |
942 | - $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE . JsonLdService::GENERAL_HANDLE; |
|
942 | + $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE.JsonLdService::GENERAL_HANDLE; |
|
943 | 943 | $generalContainer = $this->metaContainers[$generalContainerKey]; |
944 | 944 | if (($generalContainer !== null) && !empty($generalContainer->data['mainEntityOfPage'])) { |
945 | 945 | /** @var MetaJsonLd $jsonLdModel */ |
@@ -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 = []; |
@@ -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 = []; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | Event::on( |
107 | 107 | Products::class, |
108 | 108 | Products::EVENT_BEFORE_SYNCHRONIZE_PRODUCT, |
109 | - function (ShopifyProductSyncEvent $event) { |
|
109 | + function(ShopifyProductSyncEvent $event) { |
|
110 | 110 | Craft::debug( |
111 | 111 | 'Products::EVENT_BEFORE_SYNCHRONIZE_PRODUCT', |
112 | 112 | __METHOD__ |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | Event::on( |
131 | 131 | Product::class, |
132 | 132 | Product::EVENT_DEFINE_SIDEBAR_HTML, |
133 | - static function (DefineHtmlEvent $event) { |
|
133 | + static function(DefineHtmlEvent $event) { |
|
134 | 134 | Craft::debug( |
135 | 135 | 'Product::EVENT_DEFINE_SIDEBAR_HTML', |
136 | 136 | __METHOD__ |
@@ -24,7 +24,7 @@ |
||
24 | 24 | 'name' => 'General', |
25 | 25 | 'description' => 'Link Tags', |
26 | 26 | 'handle' => LinkService::GENERAL_HANDLE, |
27 | - 'class' => (string)MetaLinkContainer::class, |
|
27 | + 'class' => (string) MetaLinkContainer::class, |
|
28 | 28 | 'include' => true, |
29 | 29 | 'dependencies' => [ |
30 | 30 | ], |
@@ -24,7 +24,7 @@ |
||
24 | 24 | 'name' => 'General', |
25 | 25 | 'description' => 'Script Tags', |
26 | 26 | 'handle' => ScriptService::GENERAL_HANDLE, |
27 | - 'class' => (string)MetaScriptContainer::class, |
|
27 | + 'class' => (string) MetaScriptContainer::class, |
|
28 | 28 | 'include' => true, |
29 | 29 | 'dependencies' => [ |
30 | 30 | ], |
@@ -24,7 +24,7 @@ discard block |
||
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 | ], |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | 'name' => 'Facebook', |
36 | 36 | 'description' => 'Facebook OpenGraph Meta Tags', |
37 | 37 | 'handle' => TagService::FACEBOOK_HANDLE, |
38 | - 'class' => (string)MetaTagContainer::class, |
|
38 | + 'class' => (string) MetaTagContainer::class, |
|
39 | 39 | 'include' => true, |
40 | 40 | 'dependencies' => [ |
41 | 41 | ], |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | 'name' => 'Twitter', |
47 | 47 | 'description' => 'Twitter Card Meta Tags', |
48 | 48 | 'handle' => TagService::TWITTER_HANDLE, |
49 | - 'class' => (string)MetaTagContainer::class, |
|
49 | + 'class' => (string) MetaTagContainer::class, |
|
50 | 50 | 'include' => true, |
51 | 51 | 'dependencies' => [ |
52 | 52 | ], |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | 'name' => 'Miscellaneous', |
58 | 58 | 'description' => 'Miscellaneous Meta Tags', |
59 | 59 | 'handle' => TagService::MISC_HANDLE, |
60 | - 'class' => (string)MetaTagContainer::class, |
|
60 | + 'class' => (string) MetaTagContainer::class, |
|
61 | 61 | 'include' => true, |
62 | 62 | 'dependencies' => [ |
63 | 63 | ], |