@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | // Constants |
| 43 | 43 | // ========================================================================= |
| 44 | 44 | |
| 45 | - const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapIndexTemplate::TEMPLATE_TYPE; |
|
| 45 | + const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapIndexTemplate::TEMPLATE_TYPE; |
|
| 46 | 46 | |
| 47 | - const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapTemplate::TEMPLATE_TYPE; |
|
| 47 | + const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapTemplate::TEMPLATE_TYPE; |
|
| 48 | 48 | |
| 49 | - const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapCustomTemplate::TEMPLATE_TYPE; |
|
| 49 | + const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapCustomTemplate::TEMPLATE_TYPE; |
|
| 50 | 50 | |
| 51 | 51 | const SEARCH_ENGINE_SUBMISSION_URLS = [ |
| 52 | 52 | ]; |
@@ -243,19 +243,19 @@ discard block |
||
| 243 | 243 | $siteId = $groupSiteIds[0]; |
| 244 | 244 | $sitemapIndexUrl = $this->sitemapIndexUrlForSiteId($siteId); |
| 245 | 245 | if (!empty($sitemapIndexUrl)) { |
| 246 | - $submissionUrl = $url . urlencode($sitemapIndexUrl); |
|
| 246 | + $submissionUrl = $url.urlencode($sitemapIndexUrl); |
|
| 247 | 247 | // create new guzzle client |
| 248 | 248 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
| 249 | 249 | // Submit the sitemap index to each search engine |
| 250 | 250 | try { |
| 251 | 251 | $guzzleClient->post($submissionUrl); |
| 252 | 252 | Craft::info( |
| 253 | - 'Sitemap index submitted to: ' . $submissionUrl, |
|
| 253 | + 'Sitemap index submitted to: '.$submissionUrl, |
|
| 254 | 254 | __METHOD__ |
| 255 | 255 | ); |
| 256 | 256 | } catch (\Exception $e) { |
| 257 | 257 | Craft::error( |
| 258 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
| 258 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
| 259 | 259 | __METHOD__ |
| 260 | 260 | ); |
| 261 | 261 | } |
@@ -315,19 +315,19 @@ discard block |
||
| 315 | 315 | foreach ($searchEngineUrls as &$url) { |
| 316 | 316 | $sitemapUrl = $this->sitemapUrlForBundle($sourceBundleType, $sourceHandle, $sourceSiteId); |
| 317 | 317 | if (!empty($sitemapUrl)) { |
| 318 | - $submissionUrl = $url . urlencode($sitemapUrl); |
|
| 318 | + $submissionUrl = $url.urlencode($sitemapUrl); |
|
| 319 | 319 | // create new guzzle client |
| 320 | 320 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
| 321 | 321 | // Submit the sitemap index to each search engine |
| 322 | 322 | try { |
| 323 | 323 | $guzzleClient->post($submissionUrl); |
| 324 | 324 | Craft::info( |
| 325 | - 'Sitemap index submitted to: ' . $submissionUrl, |
|
| 325 | + 'Sitemap index submitted to: '.$submissionUrl, |
|
| 326 | 326 | __METHOD__ |
| 327 | 327 | ); |
| 328 | 328 | } catch (\Exception $e) { |
| 329 | 329 | Craft::error( |
| 330 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
| 330 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
| 331 | 331 | __METHOD__ |
| 332 | 332 | ); |
| 333 | 333 | } |
@@ -393,19 +393,19 @@ discard block |
||
| 393 | 393 | foreach ($searchEngineUrls as &$url) { |
| 394 | 394 | $sitemapUrl = $this->sitemapCustomUrlForSiteId($siteId); |
| 395 | 395 | if (!empty($sitemapUrl)) { |
| 396 | - $submissionUrl = $url . urlencode($sitemapUrl); |
|
| 396 | + $submissionUrl = $url.urlencode($sitemapUrl); |
|
| 397 | 397 | // create new guzzle client |
| 398 | 398 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
| 399 | 399 | // Submit the sitemap index to each search engine |
| 400 | 400 | try { |
| 401 | 401 | $guzzleClient->post($submissionUrl); |
| 402 | 402 | Craft::info( |
| 403 | - 'Sitemap Custom submitted to: ' . $submissionUrl, |
|
| 403 | + 'Sitemap Custom submitted to: '.$submissionUrl, |
|
| 404 | 404 | __METHOD__ |
| 405 | 405 | ); |
| 406 | 406 | } catch (\Exception $e) { |
| 407 | 407 | Craft::error( |
| 408 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
| 408 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
| 409 | 409 | __METHOD__ |
| 410 | 410 | ); |
| 411 | 411 | } |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | foreach ($sites as $site) { |
| 486 | - $result .= 'sitemap: ' . $this->sitemapIndexUrlForSiteId($site->id) . PHP_EOL; |
|
| 486 | + $result .= 'sitemap: '.$this->sitemapIndexUrlForSiteId($site->id).PHP_EOL; |
|
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | return rtrim($result, PHP_EOL); |
@@ -515,9 +515,9 @@ discard block |
||
| 515 | 515 | // Since we want a stale-while-revalidate pattern, only invalidate the cache if we're asked to |
| 516 | 516 | if ($invalidateCache) { |
| 517 | 517 | $cache = Craft::$app->getCache(); |
| 518 | - TagDependency::invalidate($cache, SitemapTemplate::SITEMAP_CACHE_TAG . $handle . $siteId); |
|
| 518 | + TagDependency::invalidate($cache, SitemapTemplate::SITEMAP_CACHE_TAG.$handle.$siteId); |
|
| 519 | 519 | Craft::info( |
| 520 | - 'Sitemap cache cleared: ' . $handle, |
|
| 520 | + 'Sitemap cache cleared: '.$handle, |
|
| 521 | 521 | __METHOD__ |
| 522 | 522 | ); |
| 523 | 523 | } |
@@ -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 | ); |
@@ -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__ |
@@ -49,16 +49,16 @@ |
||
| 49 | 49 | public function includeMetaData($dependency) |
| 50 | 50 | { |
| 51 | 51 | Craft::beginProfile('MetaTagContainer::includeMetaData', __METHOD__); |
| 52 | - $uniqueKey = $this->handle . $dependency->tags[3]; |
|
| 52 | + $uniqueKey = $this->handle.$dependency->tags[3]; |
|
| 53 | 53 | $cache = Craft::$app->getCache(); |
| 54 | 54 | if ($this->clearCache) { |
| 55 | 55 | TagDependency::invalidate($cache, $dependency->tags[3]); |
| 56 | 56 | } |
| 57 | 57 | $tagData = $cache->getOrSet( |
| 58 | - self::CONTAINER_TYPE . $uniqueKey, |
|
| 58 | + self::CONTAINER_TYPE.$uniqueKey, |
|
| 59 | 59 | function() use ($uniqueKey) { |
| 60 | 60 | Craft::info( |
| 61 | - self::CONTAINER_TYPE . ' cache miss: ' . $uniqueKey, |
|
| 61 | + self::CONTAINER_TYPE.' cache miss: '.$uniqueKey, |
|
| 62 | 62 | __METHOD__ |
| 63 | 63 | ); |
| 64 | 64 | $tagData = []; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | { |
| 115 | 115 | $model = null; |
| 116 | 116 | |
| 117 | - $className = 'nystudio107\\seomatic\\models\\jsonld\\' . $schemaType; |
|
| 117 | + $className = 'nystudio107\\seomatic\\models\\jsonld\\'.$schemaType; |
|
| 118 | 118 | /** @var $model MetaJsonLd */ |
| 119 | 119 | if (class_exists($className)) { |
| 120 | 120 | self::cleanProperties($className, $config); |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | foreach ($dataToValidate as $key => $data) { |
| 372 | 372 | /** @var array $expectedTypes */ |
| 373 | 373 | foreach ($expectedTypes as $expectedType) { |
| 374 | - $className = 'nystudio107\\seomatic\\models\\jsonld\\' . $expectedType; |
|
| 374 | + $className = 'nystudio107\\seomatic\\models\\jsonld\\'.$expectedType; |
|
| 375 | 375 | switch ($expectedType) { |
| 376 | 376 | // Text always validates |
| 377 | 377 | case 'Text': |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | case 'Date': |
| 412 | 412 | $validator = new DateValidator(); |
| 413 | 413 | $validator->type = DateValidator::TYPE_DATE; |
| 414 | - $validator->format = 'php:' . DateTime::ATOM; |
|
| 414 | + $validator->format = 'php:'.DateTime::ATOM; |
|
| 415 | 415 | if ($validator->validate($data, $error)) { |
| 416 | 416 | $validated = true; |
| 417 | 417 | } |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | $validated = true; |
| 458 | 458 | } |
| 459 | 459 | if (is_string($data)) { |
| 460 | - $targetClass = 'nystudio107\\seomatic\\models\\jsonld\\' . $data; |
|
| 460 | + $targetClass = 'nystudio107\\seomatic\\models\\jsonld\\'.$data; |
|
| 461 | 461 | if (class_exists($targetClass)) { |
| 462 | 462 | $validated = true; |
| 463 | 463 | } |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | } |
| 467 | 467 | } |
| 468 | 468 | if (!$validated) { |
| 469 | - $this->addError($attribute, 'Must be one of these types: ' . implode(', ', $expectedTypes)); |
|
| 469 | + $this->addError($attribute, 'Must be one of these types: '.implode(', ', $expectedTypes)); |
|
| 470 | 470 | } |
| 471 | 471 | } |
| 472 | 472 | } |
@@ -148,10 +148,10 @@ discard block |
||
| 148 | 148 | break; |
| 149 | 149 | } |
| 150 | 150 | // Handle the case of empty titles |
| 151 | - if ($prefix === (' ' . $separator . ' ')) { |
|
| 151 | + if ($prefix === (' '.$separator.' ')) { |
|
| 152 | 152 | $prefix = ''; |
| 153 | 153 | } |
| 154 | - if ($suffix === (' ' . $separator)) { |
|
| 154 | + if ($suffix === (' '.$separator)) { |
|
| 155 | 155 | $suffix = ''; |
| 156 | 156 | } |
| 157 | 157 | // Remove potential double spaces |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | ; |
| 160 | 160 | $suffix = preg_replace('/\s+/', ' ', $suffix); |
| 161 | 161 | ; |
| 162 | - $lengthAdjust = mb_strlen($prefix . $suffix); |
|
| 162 | + $lengthAdjust = mb_strlen($prefix.$suffix); |
|
| 163 | 163 | // Parse the data |
| 164 | 164 | $scenario = $this->scenario; |
| 165 | 165 | $this->setScenario('render'); |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | '…' |
| 179 | 179 | ); |
| 180 | 180 | } |
| 181 | - $data = $prefix . $data . $suffix; |
|
| 181 | + $data = $prefix.$data.$suffix; |
|
| 182 | 182 | } else { |
| 183 | 183 | // If no title is provided, just use the site name |
| 184 | 184 | $data = MetaValueHelper::parseString($this->siteName); |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $data = trim($data); |
| 188 | 188 | // devMode |
| 189 | 189 | if (Seomatic::$devMode) { |
| 190 | - $data = Seomatic::$settings->devModeTitlePrefix . $data; |
|
| 190 | + $data = Seomatic::$settings->devModeTitlePrefix.$data; |
|
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | |
@@ -48,16 +48,16 @@ |
||
| 48 | 48 | public function includeMetaData($dependency) |
| 49 | 49 | { |
| 50 | 50 | Craft::beginProfile('MetaTitleContainer::includeMetaData', __METHOD__); |
| 51 | - $uniqueKey = $this->handle . $dependency->tags[3]; |
|
| 51 | + $uniqueKey = $this->handle.$dependency->tags[3]; |
|
| 52 | 52 | $cache = Craft::$app->getCache(); |
| 53 | 53 | if ($this->clearCache) { |
| 54 | 54 | TagDependency::invalidate($cache, $dependency->tags[3]); |
| 55 | 55 | } |
| 56 | 56 | $tagData = $cache->getOrSet( |
| 57 | - self::CONTAINER_TYPE . $uniqueKey, |
|
| 57 | + self::CONTAINER_TYPE.$uniqueKey, |
|
| 58 | 58 | function() use ($uniqueKey) { |
| 59 | 59 | Craft::info( |
| 60 | - self::CONTAINER_TYPE . ' cache miss: ' . $uniqueKey, |
|
| 60 | + self::CONTAINER_TYPE.' cache miss: '.$uniqueKey, |
|
| 61 | 61 | __METHOD__ |
| 62 | 62 | ); |
| 63 | 63 | $tagData = ''; |