@@ -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 | |
@@ -176,10 +176,10 @@ discard block |
||
| 176 | 176 | $uniqueKey = $dependency->tags[3] ?? self::GLOBALS_CACHE_KEY; |
| 177 | 177 | $uniqueKey .= $bodyPosition; |
| 178 | 178 | $scriptData = Craft::$app->getCache()->getOrSet( |
| 179 | - self::GLOBALS_CACHE_KEY . $uniqueKey, |
|
| 180 | - function () use ($uniqueKey, $bodyPosition) { |
|
| 179 | + self::GLOBALS_CACHE_KEY.$uniqueKey, |
|
| 180 | + function() use ($uniqueKey, $bodyPosition) { |
|
| 181 | 181 | Craft::info( |
| 182 | - self::SCRIPTS_CACHE_KEY . ' cache miss: ' . $uniqueKey, |
|
| 182 | + self::SCRIPTS_CACHE_KEY.' cache miss: '.$uniqueKey, |
|
| 183 | 183 | __METHOD__ |
| 184 | 184 | ); |
| 185 | 185 | $scriptData = []; |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | foreach ($scriptContainer->data as $metaScript) { |
| 192 | 192 | /** @var MetaScript $metaScript */ |
| 193 | 193 | if (!empty($metaScript->bodyTemplatePath) |
| 194 | - && ((int)$metaScript->bodyPosition === $bodyPosition)) { |
|
| 194 | + && ((int) $metaScript->bodyPosition === $bodyPosition)) { |
|
| 195 | 195 | $scriptData[] = $metaScript->renderBodyHtml(); |
| 196 | 196 | } |
| 197 | 197 | } |
@@ -271,10 +271,10 @@ discard block |
||
| 271 | 271 | $dependency = $this->containerDependency; |
| 272 | 272 | $uniqueKey = $dependency->tags[3] ?? self::GLOBALS_CACHE_KEY; |
| 273 | 273 | list($this->metaGlobalVars, $this->metaSiteVars) = Craft::$app->getCache()->getOrSet( |
| 274 | - self::GLOBALS_CACHE_KEY . $uniqueKey, |
|
| 275 | - function () use ($uniqueKey) { |
|
| 274 | + self::GLOBALS_CACHE_KEY.$uniqueKey, |
|
| 275 | + function() use ($uniqueKey) { |
|
| 276 | 276 | Craft::info( |
| 277 | - self::GLOBALS_CACHE_KEY . ' cache miss: ' . $uniqueKey, |
|
| 277 | + self::GLOBALS_CACHE_KEY.' cache miss: '.$uniqueKey, |
|
| 278 | 278 | __METHOD__ |
| 279 | 279 | ); |
| 280 | 280 | |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | ?? 1; |
| 396 | 396 | } |
| 397 | 397 | // Handle pagination |
| 398 | - $paginationPage = 'page' . $this->paginationPage; |
|
| 398 | + $paginationPage = 'page'.$this->paginationPage; |
|
| 399 | 399 | // Get the path for the current request |
| 400 | 400 | $request = Craft::$app->getRequest(); |
| 401 | 401 | $requestPath = '/'; |
@@ -411,21 +411,21 @@ discard block |
||
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | 413 | // Get our cache key |
| 414 | - $cacheKey = $uri . $siteId . $paginationPage . $requestPath . $this->getAllowedUrlParams(); |
|
| 414 | + $cacheKey = $uri.$siteId.$paginationPage.$requestPath.$this->getAllowedUrlParams(); |
|
| 415 | 415 | // For requests with a status code of >= 400, use one cache key |
| 416 | 416 | if (!$request->isConsoleRequest) { |
| 417 | 417 | $response = Craft::$app->getResponse(); |
| 418 | 418 | if ($response->statusCode >= 400) { |
| 419 | - $cacheKey = $siteId . self::INVALID_RESPONSE_CACHE_KEY . $response->statusCode; |
|
| 419 | + $cacheKey = $siteId.self::INVALID_RESPONSE_CACHE_KEY.$response->statusCode; |
|
| 420 | 420 | } |
| 421 | 421 | } |
| 422 | 422 | // Load the meta containers |
| 423 | 423 | $dependency = new TagDependency([ |
| 424 | 424 | 'tags' => [ |
| 425 | 425 | self::GLOBAL_METACONTAINER_CACHE_TAG, |
| 426 | - self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId, |
|
| 427 | - self::METACONTAINER_CACHE_TAG . $uri . $siteId, |
|
| 428 | - self::METACONTAINER_CACHE_TAG . $cacheKey, |
|
| 426 | + self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId, |
|
| 427 | + self::METACONTAINER_CACHE_TAG.$uri.$siteId, |
|
| 428 | + self::METACONTAINER_CACHE_TAG.$cacheKey, |
|
| 429 | 429 | ], |
| 430 | 430 | ]); |
| 431 | 431 | $this->containerDependency = $dependency; |
@@ -441,10 +441,10 @@ discard block |
||
| 441 | 441 | } else { |
| 442 | 442 | $cache = Craft::$app->getCache(); |
| 443 | 443 | list($this->metaGlobalVars, $this->metaSiteVars, $this->metaSitemapVars, $this->metaContainers) = $cache->getOrSet( |
| 444 | - self::CACHE_KEY . $cacheKey, |
|
| 445 | - function () use ($uri, $siteId) { |
|
| 444 | + self::CACHE_KEY.$cacheKey, |
|
| 445 | + function() use ($uri, $siteId) { |
|
| 446 | 446 | Craft::info( |
| 447 | - 'Meta container cache miss: ' . $uri . '/' . $siteId, |
|
| 447 | + 'Meta container cache miss: '.$uri.'/'.$siteId, |
|
| 448 | 448 | __METHOD__ |
| 449 | 449 | ); |
| 450 | 450 | $this->loadGlobalMetaContainers($siteId); |
@@ -839,10 +839,10 @@ discard block |
||
| 839 | 839 | $cache = Craft::$app->getCache(); |
| 840 | 840 | TagDependency::invalidate( |
| 841 | 841 | $cache, |
| 842 | - self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId |
|
| 842 | + self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId |
|
| 843 | 843 | ); |
| 844 | 844 | Craft::info( |
| 845 | - 'Meta bundle cache cleared: ' . $metaBundleSourceId . ' / ' . $metaBundleSourceType . ' / ' . $siteId, |
|
| 845 | + 'Meta bundle cache cleared: '.$metaBundleSourceId.' / '.$metaBundleSourceType.' / '.$siteId, |
|
| 846 | 846 | __METHOD__ |
| 847 | 847 | ); |
| 848 | 848 | // Trigger an event to let other plugins/modules know we've cleared our caches |
@@ -869,9 +869,9 @@ discard block |
||
| 869 | 869 | if ($siteId === null) { |
| 870 | 870 | $siteId = Craft::$app->getSites()->currentSite->id ?? 1; |
| 871 | 871 | } |
| 872 | - TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG . $uri . $siteId); |
|
| 872 | + TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG.$uri.$siteId); |
|
| 873 | 873 | Craft::info( |
| 874 | - 'Meta container cache cleared: ' . $uri . ' / ' . $siteId, |
|
| 874 | + 'Meta container cache cleared: '.$uri.' / '.$siteId, |
|
| 875 | 875 | __METHOD__ |
| 876 | 876 | ); |
| 877 | 877 | // Trigger an event to let other plugins/modules know we've cleared our caches |
@@ -988,7 +988,7 @@ discard block |
||
| 988 | 988 | |
| 989 | 989 | // Handle re-creating the `mainEntityOfPage` so that the model injected into the |
| 990 | 990 | // templates has the appropriate attributes |
| 991 | - $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE . JsonLdService::GENERAL_HANDLE; |
|
| 991 | + $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE.JsonLdService::GENERAL_HANDLE; |
|
| 992 | 992 | $generalContainer = $this->metaContainers[$generalContainerKey]; |
| 993 | 993 | if (($generalContainer !== null) && !empty($generalContainer->data['mainEntityOfPage'])) { |
| 994 | 994 | /** @var MetaJsonLd $jsonLdModel */ |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | Event::on( |
| 106 | 106 | ProductTypes::class, |
| 107 | 107 | ProductTypes::EVENT_AFTER_SAVE_PRODUCTTYPE, |
| 108 | - function (ProductTypeEvent $event) { |
|
| 108 | + function(ProductTypeEvent $event) { |
|
| 109 | 109 | Craft::debug( |
| 110 | 110 | 'ProductTypes::EVENT_AFTER_SAVE_PRODUCTTYPE', |
| 111 | 111 | __METHOD__ |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | ProductTypes::class, |
| 122 | 122 | ProductTypes::EVENT_AFTER_SAVE_PRODUCTTYPE, |
| 123 | 123 | /** @var ProductTypeEvent $event */ |
| 124 | - static function ($event) { |
|
| 124 | + static function($event) { |
|
| 125 | 125 | Craft::debug( |
| 126 | 126 | 'ProductTypes::EVENT_AFTER_SAVE_PRODUCTTYPE', |
| 127 | 127 | __METHOD__ |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | Event::on( |
| 178 | 178 | Product::class, |
| 179 | 179 | Product::EVENT_DEFINE_SIDEBAR_HTML, |
| 180 | - static function (DefineHtmlEvent $event) { |
|
| 180 | + static function(DefineHtmlEvent $event) { |
|
| 181 | 181 | Craft::debug( |
| 182 | 182 | 'Product::EVENT_DEFINE_SIDEBAR_HTML', |
| 183 | 183 | __METHOD__ |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
| 387 | 387 | [ |
| 388 | 388 | 'sourceId' => $sourceModel->id, |
| 389 | - 'sourceName' => (string)$sourceModel->name, |
|
| 389 | + 'sourceName' => (string) $sourceModel->name, |
|
| 390 | 390 | 'sourceHandle' => $sourceModel->handle, |
| 391 | 391 | ] |
| 392 | 392 | ); |
@@ -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__ |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | Event::on( |
| 177 | 177 | Product::class, |
| 178 | 178 | Product::EVENT_DEFINE_SIDEBAR_HTML, |
| 179 | - static function (DefineHtmlEvent $event) { |
|
| 179 | + static function(DefineHtmlEvent $event) { |
|
| 180 | 180 | Craft::debug( |
| 181 | 181 | 'Product::EVENT_DEFINE_SIDEBAR_HTML', |
| 182 | 182 | __METHOD__ |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
| 386 | 386 | [ |
| 387 | 387 | 'sourceId' => $sourceModel->id, |
| 388 | - 'sourceName' => (string)$sourceModel->name, |
|
| 388 | + 'sourceName' => (string) $sourceModel->name, |
|
| 389 | 389 | 'sourceHandle' => $sourceModel->handle, |
| 390 | 390 | ] |
| 391 | 391 | ); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | /** |
| 50 | 50 | * @var bool|array |
| 51 | 51 | */ |
| 52 | - protected array|bool|int $allowAnonymous = [ |
|
| 52 | + protected array | bool | int $allowAnonymous = [ |
|
| 53 | 53 | ]; |
| 54 | 54 | |
| 55 | 55 | // Public Methods |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function actionGenerate() |
| 76 | 76 | { |
| 77 | - echo 'Generating sitemap' . PHP_EOL; |
|
| 77 | + echo 'Generating sitemap'.PHP_EOL; |
|
| 78 | 78 | if ($this->siteId !== null) { |
| 79 | 79 | $siteIds[] = $this->siteId; |
| 80 | 80 | } else { |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | ]); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - echo '---' . PHP_EOL; |
|
| 119 | + echo '---'.PHP_EOL; |
|
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | // Add a URL to the schema.org type if this is a MetaJsonLD object |
| 159 | 159 | if ($isMetaJsonLdModel) { |
| 160 | 160 | /** @var $this MetaJsonLd */ |
| 161 | - $extraInfo = ' for http://schema.org/' . $this->type; |
|
| 161 | + $extraInfo = ' for http://schema.org/'.$this->type; |
|
| 162 | 162 | } |
| 163 | 163 | $errorMsg = |
| 164 | 164 | Craft::t('seomatic', 'Scenario: "') |
@@ -169,10 +169,10 @@ discard block |
||
| 169 | 169 | . print_r($this->render(), true); |
| 170 | 170 | Craft::info($errorMsg, __METHOD__); |
| 171 | 171 | foreach ($this->errors as $param => $errors) { |
| 172 | - $errorMsg = Craft::t('seomatic', $errorLabel) . $param; |
|
| 172 | + $errorMsg = Craft::t('seomatic', $errorLabel).$param; |
|
| 173 | 173 | /** @var array $errors */ |
| 174 | 174 | foreach ($errors as $error) { |
| 175 | - $errorMsg .= ' -> ' . $error; |
|
| 175 | + $errorMsg .= ' -> '.$error; |
|
| 176 | 176 | // Change the error level depending on the error message if this is a MetaJsonLD object |
| 177 | 177 | if ($isMetaJsonLdModel) { |
| 178 | 178 | if (strpos($error, 'recommended') !== false) { |
@@ -185,15 +185,15 @@ discard block |
||
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | - Craft::info(strtoupper($logLevel) . ' - ' . $errorMsg, __METHOD__); |
|
| 188 | + Craft::info(strtoupper($logLevel).' - '.$errorMsg, __METHOD__); |
|
| 189 | 189 | // Extra debugging info for MetaJsonLd objects |
| 190 | 190 | if ($isMetaJsonLdModel) { |
| 191 | 191 | /** @var MetaJsonLd $className */ |
| 192 | 192 | $className = \get_class($this); |
| 193 | 193 | if (!empty($className::$schemaPropertyDescriptions[$param])) { |
| 194 | - $errorMsg = Craft::t('seomatic', $errorLabel) . $param; |
|
| 194 | + $errorMsg = Craft::t('seomatic', $errorLabel).$param; |
|
| 195 | 195 | /** @var $className MetaJsonLd */ |
| 196 | - $errorMsg .= ' -> ' . $className::$schemaPropertyDescriptions[$param]; |
|
| 196 | + $errorMsg .= ' -> '.$className::$schemaPropertyDescriptions[$param]; |
|
| 197 | 197 | Craft::info($errorMsg, __METHOD__); |
| 198 | 198 | } |
| 199 | 199 | } |
@@ -127,16 +127,16 @@ discard block |
||
| 127 | 127 | $dependency = new TagDependency([ |
| 128 | 128 | 'tags' => [ |
| 129 | 129 | self::GLOBAL_SITEMAP_CACHE_TAG, |
| 130 | - self::SITEMAP_CACHE_TAG . $handle . $siteId, |
|
| 130 | + self::SITEMAP_CACHE_TAG.$handle.$siteId, |
|
| 131 | 131 | ], |
| 132 | 132 | ]); |
| 133 | 133 | |
| 134 | - return $cache->getOrSet(self::CACHE_KEY . $groupId . self::CUSTOM_SCOPE . $handle . $siteId, function () use ( |
|
| 134 | + return $cache->getOrSet(self::CACHE_KEY.$groupId.self::CUSTOM_SCOPE.$handle.$siteId, function() use ( |
|
| 135 | 135 | $handle, |
| 136 | 136 | $siteId |
| 137 | 137 | ) { |
| 138 | 138 | Craft::info( |
| 139 | - 'Sitemap Custom cache miss: ' . $handle . '/' . $siteId, |
|
| 139 | + 'Sitemap Custom cache miss: '.$handle.'/'.$siteId, |
|
| 140 | 140 | __METHOD__ |
| 141 | 141 | ); |
| 142 | 142 | $lines = []; |
@@ -211,9 +211,9 @@ discard block |
||
| 211 | 211 | { |
| 212 | 212 | $handle = self::CUSTOM_HANDLE; |
| 213 | 213 | $cache = Craft::$app->getCache(); |
| 214 | - TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG . $handle . $siteId); |
|
| 214 | + TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG.$handle.$siteId); |
|
| 215 | 215 | Craft::info( |
| 216 | - 'Sitemap Custom cache cleared: ' . $handle, |
|
| 216 | + 'Sitemap Custom cache cleared: '.$handle, |
|
| 217 | 217 | __METHOD__ |
| 218 | 218 | ); |
| 219 | 219 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function getFilename(int $groupId): string |
| 119 | 119 | { |
| 120 | - return 'sitemaps-' . $groupId . '-sitemap.xml'; |
|
| 120 | + return 'sitemaps-'.$groupId.'-sitemap.xml'; |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | ], |
| 151 | 151 | ]); |
| 152 | 152 | |
| 153 | - return $cache->getOrSet(self::CACHE_KEY . $groupId . '.' . $siteId, function () use ($groupSiteIds, $siteId) { |
|
| 153 | + return $cache->getOrSet(self::CACHE_KEY.$groupId.'.'.$siteId, function() use ($groupSiteIds, $siteId) { |
|
| 154 | 154 | Craft::info( |
| 155 | 155 | 'Sitemap index cache miss', |
| 156 | 156 | __METHOD__ |
@@ -225,10 +225,10 @@ |
||
| 225 | 225 | } |
| 226 | 226 | // Make sure these are strings |
| 227 | 227 | if (!empty($this->facebookProfileId)) { |
| 228 | - $this->facebookProfileId = (string)$this->facebookProfileId; |
|
| 228 | + $this->facebookProfileId = (string) $this->facebookProfileId; |
|
| 229 | 229 | } |
| 230 | 230 | if (!empty($this->facebookAppId)) { |
| 231 | - $this->facebookAppId = (string)$this->facebookAppId; |
|
| 231 | + $this->facebookAppId = (string) $this->facebookAppId; |
|
| 232 | 232 | } |
| 233 | 233 | // Identity |
| 234 | 234 | if ($this->identity !== null && is_array($this->identity)) { |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $className = MetaTag::class; |
| 80 | 80 | if ($tagType) { |
| 81 | 81 | // Potentially load a sub-type of MetaTag |
| 82 | - $tagClassName = 'nystudio107\\seomatic\\models\\metatag\\' . ucfirst($tagType) . 'Tag'; |
|
| 82 | + $tagClassName = 'nystudio107\\seomatic\\models\\metatag\\'.ucfirst($tagType).'Tag'; |
|
| 83 | 83 | /** @var $model MetaTag */ |
| 84 | 84 | if (class_exists($tagClassName)) { |
| 85 | 85 | $className = $tagClassName; |
@@ -155,10 +155,10 @@ discard block |
||
| 155 | 155 | if (Seomatic::$devMode) { |
| 156 | 156 | $error = Craft::t( |
| 157 | 157 | 'seomatic', |
| 158 | - '{tagtype} tag `{key}` did not render because it is missing attributes. ' . print_r($data, true), |
|
| 158 | + '{tagtype} tag `{key}` did not render because it is missing attributes. '.print_r($data, true), |
|
| 159 | 159 | ['tagtype' => 'Meta', 'key' => $this->key] |
| 160 | 160 | ); |
| 161 | - Craft::info('WARNING - ' . $error, __METHOD__); |
|
| 161 | + Craft::info('WARNING - '.$error, __METHOD__); |
|
| 162 | 162 | } |
| 163 | 163 | $shouldRender = false; |
| 164 | 164 | } |