@@ -208,7 +208,7 @@ |
||
| 208 | 208 | * 'default' => 'http://example.com/', |
| 209 | 209 | * 'spanish' => 'http://example.com/es/', |
| 210 | 210 | * ], */ |
| 211 | - public string|array $siteUrlOverride = ''; |
|
| 211 | + public string | array $siteUrlOverride = ''; |
|
| 212 | 212 | |
| 213 | 213 | /** |
| 214 | 214 | * @var int|null |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | if (!empty($string)) { |
| 76 | 76 | $string = HtmlPurifier::process($string, ['HTML.Allowed' => '']); |
| 77 | 77 | $string = html_entity_decode($string, ENT_NOQUOTES, 'UTF-8'); |
| 78 | - $result = (string)Stringy::create($string)->truncate($length, $substring); |
|
| 78 | + $result = (string) Stringy::create($string)->truncate($length, $substring); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | return $result; |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | if (!empty($string)) { |
| 101 | 101 | $string = HtmlPurifier::process($string, ['HTML.Allowed' => '']); |
| 102 | 102 | $string = html_entity_decode($string, ENT_NOQUOTES, 'UTF-8'); |
| 103 | - $result = (string)Stringy::create($string)->safeTruncate($length, $substring); |
|
| 103 | + $result = (string) Stringy::create($string)->safeTruncate($length, $substring); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | return $result; |
@@ -134,9 +134,9 @@ discard block |
||
| 134 | 134 | $result = self::smartStripTags(Doxter::$plugin->getService()->parseMarkdown($field->getRaw())); |
| 135 | 135 | } else { |
| 136 | 136 | if (self::isArrayLike($field)) { |
| 137 | - $result = self::smartStripTags((string)$field[0]); |
|
| 137 | + $result = self::smartStripTags((string) $field[0]); |
|
| 138 | 138 | } else { |
| 139 | - $result = self::smartStripTags((string)$field); |
|
| 139 | + $result = self::smartStripTags((string) $field); |
|
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $tags = $tags->all(); |
| 164 | 164 | } |
| 165 | 165 | foreach ($tags as $tag) { |
| 166 | - $result .= $tag->title . ', '; |
|
| 166 | + $result .= $tag->title.', '; |
|
| 167 | 167 | } |
| 168 | 168 | $result = rtrim($result, ', '); |
| 169 | 169 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | foreach ($fieldClasses as $fieldClassKey) { |
| 206 | 206 | if ($field instanceof $fieldClassKey) { |
| 207 | 207 | if ($field->handle === $fieldHandle || empty($fieldHandle)) { |
| 208 | - $result .= self::extractTextFromField($block[$field->handle]) . ' '; |
|
| 208 | + $result .= self::extractTextFromField($block[$field->handle]).' '; |
|
| 209 | 209 | } |
| 210 | 210 | } |
| 211 | 211 | } |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | foreach ($fieldClasses as $fieldClassKey) { |
| 248 | 248 | if ($field instanceof $fieldClassKey) { |
| 249 | 249 | if ($field->handle === $fieldHandle || empty($fieldHandle)) { |
| 250 | - $result .= self::extractTextFromField($block[$field->handle]) . ' '; |
|
| 250 | + $result .= self::extractTextFromField($block[$field->handle]).' '; |
|
| 251 | 251 | } |
| 252 | 252 | } |
| 253 | 253 | } |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | foreach ($fieldClasses as $fieldClassKey) { |
| 298 | 298 | if ($field instanceof $fieldClassKey) { |
| 299 | 299 | if ($field->handle === $fieldHandle || empty($fieldHandle)) { |
| 300 | - $result .= self::extractTextFromField($block[$field->handle]) . ' '; |
|
| 300 | + $result .= self::extractTextFromField($block[$field->handle]).' '; |
|
| 301 | 301 | } |
| 302 | 302 | } |
| 303 | 303 | } |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | $str = html_entity_decode($str, ENT_NOQUOTES, 'UTF-8'); |
| 397 | 397 | $str = rawurldecode($str); |
| 398 | 398 | // Remove any linebreaks |
| 399 | - $str = (string)preg_replace("/\r|\n/", "", $str); |
|
| 399 | + $str = (string) preg_replace("/\r|\n/", "", $str); |
|
| 400 | 400 | $str = HtmlPurifier::process($str, ['HTML.Allowed' => '']); |
| 401 | 401 | $str = html_entity_decode($str, ENT_NOQUOTES, 'UTF-8'); |
| 402 | 402 | // Remove any embedded Twig code |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | $language = 'English'; |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | - $className = 'PhpScience\\TextRank\\Tool\\StopWords\\' . ucfirst($language); |
|
| 490 | + $className = 'PhpScience\\TextRank\\Tool\\StopWords\\'.ucfirst($language); |
|
| 491 | 491 | if (class_exists($className)) { |
| 492 | 492 | $stopWords = new $className(); |
| 493 | 493 | } |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | /** |
| 160 | 160 | * @inheritdoc |
| 161 | 161 | */ |
| 162 | - public function getContentColumnType(): array|string |
|
| 162 | + public function getContentColumnType(): array | string |
|
| 163 | 163 | { |
| 164 | 164 | return Schema::TYPE_TEXT; |
| 165 | 165 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | // Handle the mainEntityOfPage |
| 225 | 225 | $mainEntity = ''; |
| 226 | - if (in_array('mainEntityOfPage', (array)$this->generalEnabledFields, false) && |
|
| 226 | + if (in_array('mainEntityOfPage', (array) $this->generalEnabledFields, false) && |
|
| 227 | 227 | !empty($config['metaBundleSettings'])) { |
| 228 | 228 | $mainEntity = SchemaHelper::getSpecificEntityType($config['metaBundleSettings'], true); |
| 229 | 229 | } |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | if ($element !== null && $element->uri !== null) { |
| 378 | 378 | $siteId = $element->siteId; |
| 379 | 379 | $uri = $element->uri; |
| 380 | - $cacheKey = self::CACHE_KEY . $uri . $siteId . $this->elementDisplayPreviewType; |
|
| 380 | + $cacheKey = self::CACHE_KEY.$uri.$siteId.$this->elementDisplayPreviewType; |
|
| 381 | 381 | $metaBundleSourceType = Seomatic::$plugin->seoElements->getMetaBundleTypeFromElement($element); |
| 382 | 382 | $seoElement = Seomatic::$plugin->seoElements->getSeoElementByMetaBundleType($metaBundleSourceType); |
| 383 | 383 | $metaBundleSourceType = SeoEntry::getMetaBundleType(); |
@@ -388,14 +388,14 @@ discard block |
||
| 388 | 388 | $dependency = new TagDependency([ |
| 389 | 389 | 'tags' => [ |
| 390 | 390 | MetaContainers::GLOBAL_METACONTAINER_CACHE_TAG, |
| 391 | - MetaContainers::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId, |
|
| 392 | - MetaContainers::METACONTAINER_CACHE_TAG . $uri . $siteId, |
|
| 391 | + MetaContainers::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId, |
|
| 392 | + MetaContainers::METACONTAINER_CACHE_TAG.$uri.$siteId, |
|
| 393 | 393 | ], |
| 394 | 394 | ]); |
| 395 | 395 | $cache = Craft::$app->getCache(); |
| 396 | 396 | $cacheDuration = null; |
| 397 | 397 | $html = $cache->getOrSet( |
| 398 | - self::CACHE_KEY . $cacheKey, |
|
| 398 | + self::CACHE_KEY.$cacheKey, |
|
| 399 | 399 | function() use ($uri, $siteId, $element) { |
| 400 | 400 | Seomatic::$plugin->metaContainers->previewMetaContainers($uri, $siteId, true, true, $element); |
| 401 | 401 | $variables = [ |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | array &$variables, |
| 438 | 438 | ) { |
| 439 | 439 | $variables['textFieldSources'] = array_merge( |
| 440 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'], |
|
| 440 | + ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'], |
|
| 441 | 441 | FieldHelper::fieldsOfTypeFromElement( |
| 442 | 442 | $element, |
| 443 | 443 | FieldHelper::TEXT_FIELD_CLASS_KEY, |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | ) |
| 446 | 446 | ); |
| 447 | 447 | $variables['assetFieldSources'] = array_merge( |
| 448 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields']], |
|
| 448 | + ['entryGroup' => ['optgroup' => $groupName.' Fields']], |
|
| 449 | 449 | FieldHelper::fieldsOfTypeFromElement( |
| 450 | 450 | $element, |
| 451 | 451 | FieldHelper::ASSET_FIELD_CLASS_KEY, |
@@ -43,11 +43,11 @@ discard block |
||
| 43 | 43 | // Constants |
| 44 | 44 | // ========================================================================= |
| 45 | 45 | |
| 46 | - public const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapIndexTemplate::TEMPLATE_TYPE; |
|
| 46 | + public const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapIndexTemplate::TEMPLATE_TYPE; |
|
| 47 | 47 | |
| 48 | - public const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapTemplate::TEMPLATE_TYPE; |
|
| 48 | + public const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapTemplate::TEMPLATE_TYPE; |
|
| 49 | 49 | |
| 50 | - public const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapCustomTemplate::TEMPLATE_TYPE; |
|
| 50 | + public const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapCustomTemplate::TEMPLATE_TYPE; |
|
| 51 | 51 | |
| 52 | 52 | public const SEARCH_ENGINE_SUBMISSION_URLS = [ |
| 53 | 53 | ]; |
@@ -238,19 +238,19 @@ discard block |
||
| 238 | 238 | $siteId = $groupSiteIds[0]; |
| 239 | 239 | $sitemapIndexUrl = $this->sitemapIndexUrlForSiteId($siteId); |
| 240 | 240 | if (!empty($sitemapIndexUrl)) { |
| 241 | - $submissionUrl = $url . urlencode($sitemapIndexUrl); |
|
| 241 | + $submissionUrl = $url.urlencode($sitemapIndexUrl); |
|
| 242 | 242 | // create new guzzle client |
| 243 | 243 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
| 244 | 244 | // Submit the sitemap index to each search engine |
| 245 | 245 | try { |
| 246 | 246 | $guzzleClient->post($submissionUrl); |
| 247 | 247 | Craft::info( |
| 248 | - 'Sitemap index submitted to: ' . $submissionUrl, |
|
| 248 | + 'Sitemap index submitted to: '.$submissionUrl, |
|
| 249 | 249 | __METHOD__ |
| 250 | 250 | ); |
| 251 | 251 | } catch (\Exception $e) { |
| 252 | 252 | Craft::error( |
| 253 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
| 253 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
| 254 | 254 | __METHOD__ |
| 255 | 255 | ); |
| 256 | 256 | } |
@@ -312,19 +312,19 @@ discard block |
||
| 312 | 312 | foreach ($searchEngineUrls as &$url) { |
| 313 | 313 | $sitemapUrl = $this->sitemapUrlForBundle($sourceBundleType, $sourceHandle, $sourceSiteId); |
| 314 | 314 | if (!empty($sitemapUrl)) { |
| 315 | - $submissionUrl = $url . urlencode($sitemapUrl); |
|
| 315 | + $submissionUrl = $url.urlencode($sitemapUrl); |
|
| 316 | 316 | // create new guzzle client |
| 317 | 317 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
| 318 | 318 | // Submit the sitemap index to each search engine |
| 319 | 319 | try { |
| 320 | 320 | $guzzleClient->post($submissionUrl); |
| 321 | 321 | Craft::info( |
| 322 | - 'Sitemap index submitted to: ' . $submissionUrl, |
|
| 322 | + 'Sitemap index submitted to: '.$submissionUrl, |
|
| 323 | 323 | __METHOD__ |
| 324 | 324 | ); |
| 325 | 325 | } catch (\Exception $e) { |
| 326 | 326 | Craft::error( |
| 327 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
| 327 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
| 328 | 328 | __METHOD__ |
| 329 | 329 | ); |
| 330 | 330 | } |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | . '-' |
| 366 | 366 | . $metaBundle->sourceSiteId |
| 367 | 367 | . '-sitemap' |
| 368 | - . (!empty($page) ? '-p' . $page : '') |
|
| 368 | + . (!empty($page) ? '-p'.$page : '') |
|
| 369 | 369 | . '.xml', |
| 370 | 370 | null, |
| 371 | 371 | null, |
@@ -394,19 +394,19 @@ discard block |
||
| 394 | 394 | foreach ($searchEngineUrls as &$url) { |
| 395 | 395 | $sitemapUrl = $this->sitemapCustomUrlForSiteId($siteId); |
| 396 | 396 | if (!empty($sitemapUrl)) { |
| 397 | - $submissionUrl = $url . urlencode($sitemapUrl); |
|
| 397 | + $submissionUrl = $url.urlencode($sitemapUrl); |
|
| 398 | 398 | // create new guzzle client |
| 399 | 399 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
| 400 | 400 | // Submit the sitemap index to each search engine |
| 401 | 401 | try { |
| 402 | 402 | $guzzleClient->post($submissionUrl); |
| 403 | 403 | Craft::info( |
| 404 | - 'Sitemap Custom submitted to: ' . $submissionUrl, |
|
| 404 | + 'Sitemap Custom submitted to: '.$submissionUrl, |
|
| 405 | 405 | __METHOD__ |
| 406 | 406 | ); |
| 407 | 407 | } catch (\Exception $e) { |
| 408 | 408 | Craft::error( |
| 409 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
| 409 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
| 410 | 410 | __METHOD__ |
| 411 | 411 | ); |
| 412 | 412 | } |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | foreach ($sites as $site) { |
| 487 | - $result .= 'sitemap: ' . $this->sitemapIndexUrlForSiteId($site->id) . PHP_EOL; |
|
| 487 | + $result .= 'sitemap: '.$this->sitemapIndexUrlForSiteId($site->id).PHP_EOL; |
|
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | return rtrim($result, PHP_EOL); |
@@ -515,9 +515,9 @@ discard block |
||
| 515 | 515 | { |
| 516 | 516 | // Always just invalidate the sitemap cache now, since we're doing paginated sitemaps |
| 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 | } |
@@ -90,24 +90,24 @@ |
||
| 90 | 90 | } |
| 91 | 91 | // Get our cache key |
| 92 | 92 | $asArrayKey = $asArray ? 'true' : 'false'; |
| 93 | - $cacheKey = $uri . $siteId . implode($containerKeys) . $asArrayKey . Seomatic::$environment . $token; |
|
| 93 | + $cacheKey = $uri.$siteId.implode($containerKeys).$asArrayKey.Seomatic::$environment.$token; |
|
| 94 | 94 | // Load the meta containers |
| 95 | 95 | $dependency = new TagDependency([ |
| 96 | 96 | 'tags' => [ |
| 97 | 97 | $metaContainers::GLOBAL_METACONTAINER_CACHE_TAG, |
| 98 | - $metaContainers::METACONTAINER_CACHE_TAG . $sourceId . $sourceBundleType . $siteId, |
|
| 99 | - $metaContainers::METACONTAINER_CACHE_TAG . $uri . $siteId, |
|
| 100 | - $metaContainers::METACONTAINER_CACHE_TAG . $cacheKey, |
|
| 98 | + $metaContainers::METACONTAINER_CACHE_TAG.$sourceId.$sourceBundleType.$siteId, |
|
| 99 | + $metaContainers::METACONTAINER_CACHE_TAG.$uri.$siteId, |
|
| 100 | + $metaContainers::METACONTAINER_CACHE_TAG.$cacheKey, |
|
| 101 | 101 | ], |
| 102 | 102 | ]); |
| 103 | 103 | |
| 104 | 104 | $cache = Craft::$app->getCache(); |
| 105 | 105 | $result = $cache->getOrSet( |
| 106 | - self::CACHE_KEY . $cacheKey, |
|
| 106 | + self::CACHE_KEY.$cacheKey, |
|
| 107 | 107 | function() use ($uri, $siteId, $containerKeys, $asArray) { |
| 108 | 108 | $result = []; |
| 109 | 109 | Craft::info( |
| 110 | - 'Meta controller container cache miss: ' . $uri . '/' . $siteId, |
|
| 110 | + 'Meta controller container cache miss: '.$uri.'/'.$siteId, |
|
| 111 | 111 | __METHOD__ |
| 112 | 112 | ); |
| 113 | 113 | // Load the meta containers and parse our globals |
@@ -140,10 +140,10 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | $cache = Craft::$app->getCache(); |
| 143 | - $pageCacheSuffix = 's' . (int)$metaBundle->metaSitemapVars->sitemapPageSize . 'p' . $page; |
|
| 143 | + $pageCacheSuffix = 's'.(int) $metaBundle->metaSitemapVars->sitemapPageSize.'p'.$page; |
|
| 144 | 144 | |
| 145 | - $uniqueKey = $groupId . $type . $handle . $siteId . $pageCacheSuffix; |
|
| 146 | - $cacheKey = self::CACHE_KEY . $uniqueKey; |
|
| 145 | + $uniqueKey = $groupId.$type.$handle.$siteId.$pageCacheSuffix; |
|
| 146 | + $cacheKey = self::CACHE_KEY.$uniqueKey; |
|
| 147 | 147 | $result = $cache->get($cacheKey); |
| 148 | 148 | |
| 149 | 149 | // If the sitemap isn't cached, render it immediately |
@@ -160,8 +160,8 @@ discard block |
||
| 160 | 160 | $dependency = new TagDependency([ |
| 161 | 161 | 'tags' => [ |
| 162 | 162 | self::GLOBAL_SITEMAP_CACHE_TAG, |
| 163 | - self::SITEMAP_CACHE_TAG . $handle . $siteId, |
|
| 164 | - self::SITEMAP_CACHE_TAG . $handle . $siteId . $pageCacheSuffix, |
|
| 163 | + self::SITEMAP_CACHE_TAG.$handle.$siteId, |
|
| 164 | + self::SITEMAP_CACHE_TAG.$handle.$siteId.$pageCacheSuffix, |
|
| 165 | 165 | ], |
| 166 | 166 | ]); |
| 167 | 167 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | // Output some info if this is a console app |
| 175 | 175 | if (Craft::$app instanceof ConsoleApplication) { |
| 176 | - echo 'Sitemap cache result: ' . print_r($result, true) . ' for cache key: ' . $cacheKey . PHP_EOL; |
|
| 176 | + echo 'Sitemap cache result: '.print_r($result, true).' for cache key: '.$cacheKey.PHP_EOL; |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | // If the FastCGI Cache Bust plugin is installed, clear its caches too |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | } else { |
| 189 | 189 | if (Craft::$app instanceof ConsoleApplication) { |
| 190 | - echo 'Found in cache' . PHP_EOL; |
|
| 190 | + echo 'Found in cache'.PHP_EOL; |
|
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | |
@@ -203,9 +203,9 @@ discard block |
||
| 203 | 203 | public function invalidateCache(string $handle, int $siteId) |
| 204 | 204 | { |
| 205 | 205 | $cache = Craft::$app->getCache(); |
| 206 | - TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG . $handle . $siteId); |
|
| 206 | + TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG.$handle.$siteId); |
|
| 207 | 207 | Craft::info( |
| 208 | - 'Sitemap cache cleared: ' . $handle, |
|
| 208 | + 'Sitemap cache cleared: '.$handle, |
|
| 209 | 209 | __METHOD__ |
| 210 | 210 | ); |
| 211 | 211 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | ->limit($metaBundle->metaSitemapVars->sitemapLimit); |
| 224 | 224 | if ($metaBundle->sourceType === 'structure' |
| 225 | 225 | && !empty($metaBundle->metaSitemapVars->structureDepth)) { |
| 226 | - $query->level('<=' . $metaBundle->metaSitemapVars->structureDepth); |
|
| 226 | + $query->level('<='.$metaBundle->metaSitemapVars->structureDepth); |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | return $query; |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | if (!empty($typeId)) { |
| 272 | 272 | $query |
| 273 | 273 | ->andWhere([ |
| 274 | - 'typeId' => (int)$typeId, |
|
| 274 | + 'typeId' => (int) $typeId, |
|
| 275 | 275 | ]); |
| 276 | 276 | } |
| 277 | 277 | $element = $query->one(); |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
| 399 | 399 | [ |
| 400 | 400 | 'sourceId' => $sourceModel->id, |
| 401 | - 'sourceName' => (string)$sourceModel->name, |
|
| 401 | + 'sourceName' => (string) $sourceModel->name, |
|
| 402 | 402 | 'sourceHandle' => $sourceModel->handle, |
| 403 | 403 | 'sourceType' => $sourceModel->type, |
| 404 | 404 | ] |
@@ -508,8 +508,8 @@ discard block |
||
| 508 | 508 | string $sourceBundleType, |
| 509 | 509 | string $sourceHandle, |
| 510 | 510 | string $siteHandle = null, |
| 511 | - $typeId = null, |
|
| 512 | - $loadFromSiteHandle = null, |
|
| 511 | + $typeId = null, |
|
| 512 | + $loadFromSiteHandle = null, |
|
| 513 | 513 | ): Response { |
| 514 | 514 | $variables = []; |
| 515 | 515 | // @TODO: Let people choose an entry/categorygroup/product as the preview |
@@ -1222,7 +1222,7 @@ discard block |
||
| 1222 | 1222 | string $sourceHandle, |
| 1223 | 1223 | string $groupName, |
| 1224 | 1224 | array &$variables, |
| 1225 | - $typeId = null, |
|
| 1225 | + $typeId = null, |
|
| 1226 | 1226 | ) { |
| 1227 | 1227 | $variables['textFieldSources'] = array_merge( |
| 1228 | 1228 | ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'], |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | /** |
| 89 | 89 | * @inheritdoc |
| 90 | 90 | */ |
| 91 | - protected array|bool|int $allowAnonymous = [ |
|
| 91 | + protected array | bool | int $allowAnonymous = [ |
|
| 92 | 92 | ]; |
| 93 | 93 | |
| 94 | 94 | // Public Methods |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $variables['pluginName'] = Seomatic::$settings->pluginName; |
| 133 | 133 | $variables['title'] = $templateTitle; |
| 134 | 134 | $variables['docTitle'] = "{$pluginName} - {$templateTitle}"; |
| 135 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 135 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 136 | 136 | $variables['crumbs'] = [ |
| 137 | 137 | [ |
| 138 | 138 | 'label' => $pluginName, |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | ], |
| 141 | 141 | [ |
| 142 | 142 | 'label' => $templateTitle, |
| 143 | - 'url' => UrlHelper::cpUrl('seomatic/dashboard' . $siteHandleUri), |
|
| 143 | + 'url' => UrlHelper::cpUrl('seomatic/dashboard'.$siteHandleUri), |
|
| 144 | 144 | ], |
| 145 | 145 | ]; |
| 146 | 146 | $variables['selectedSubnavItem'] = 'dashboard'; |
@@ -163,11 +163,11 @@ discard block |
||
| 163 | 163 | foreach ($variables['metaBundles'] as $metaBundle) { |
| 164 | 164 | $stat = 0; |
| 165 | 165 | foreach (self::SEO_SETUP_FIELDS as $setupField => $setupLabel) { |
| 166 | - $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]); |
|
| 166 | + $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]); |
|
| 167 | 167 | $value = $variables['contentSetupChecklist'][$setupField]['value'] ?? 0; |
| 168 | 168 | $variables['contentSetupChecklist'][$setupField] = [ |
| 169 | 169 | 'label' => $setupLabel, |
| 170 | - 'value' => $value + (int)!empty($metaBundle->metaGlobalVars[$setupField]), |
|
| 170 | + 'value' => $value + (int) !empty($metaBundle->metaGlobalVars[$setupField]), |
|
| 171 | 171 | ]; |
| 172 | 172 | } |
| 173 | 173 | $stat = round($numGrades - (($stat * $numGrades) / $numFields)); |
@@ -178,16 +178,16 @@ discard block |
||
| 178 | 178 | } |
| 179 | 179 | // Global SEO grades |
| 180 | 180 | Seomatic::$previewingMetaContainers = true; |
| 181 | - $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int)$siteId); |
|
| 181 | + $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int) $siteId); |
|
| 182 | 182 | Seomatic::$previewingMetaContainers = false; |
| 183 | 183 | if ($metaBundle !== null) { |
| 184 | 184 | $stat = 0; |
| 185 | 185 | $variables['globalSetupChecklist'] = []; |
| 186 | 186 | foreach (self::SEO_SETUP_FIELDS as $setupField => $setupLabel) { |
| 187 | - $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]); |
|
| 187 | + $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]); |
|
| 188 | 188 | $variables['globalSetupChecklist'][$setupField] = [ |
| 189 | 189 | 'label' => $setupLabel, |
| 190 | - 'value' => (int)!empty($metaBundle->metaGlobalVars[$setupField]), |
|
| 190 | + 'value' => (int) !empty($metaBundle->metaGlobalVars[$setupField]), |
|
| 191 | 191 | ]; |
| 192 | 192 | } |
| 193 | 193 | $stat = round(($stat / $numFields) * 100); |
@@ -197,17 +197,17 @@ discard block |
||
| 197 | 197 | $stat = 0; |
| 198 | 198 | $variables['siteSetupChecklist'] = []; |
| 199 | 199 | foreach (self::SITE_SETUP_FIELDS as $setupField => $setupLabel) { |
| 200 | - $stat += (int)!empty($metaBundle->metaSiteVars[$setupField]); |
|
| 200 | + $stat += (int) !empty($metaBundle->metaSiteVars[$setupField]); |
|
| 201 | 201 | $variables['siteSetupChecklist'][$setupField] = [ |
| 202 | 202 | 'label' => $setupLabel, |
| 203 | - 'value' => (int)!empty($metaBundle->metaSiteVars[$setupField]), |
|
| 203 | + 'value' => (int) !empty($metaBundle->metaSiteVars[$setupField]), |
|
| 204 | 204 | ]; |
| 205 | 205 | } |
| 206 | 206 | foreach (self::IDENTITY_SETUP_FIELDS as $setupField => $setupLabel) { |
| 207 | - $stat += (int)!empty($metaBundle->metaSiteVars->identity[$setupField]); |
|
| 207 | + $stat += (int) !empty($metaBundle->metaSiteVars->identity[$setupField]); |
|
| 208 | 208 | $variables['siteSetupChecklist'][$setupField] = [ |
| 209 | 209 | 'label' => $setupLabel, |
| 210 | - 'value' => (int)!empty($metaBundle->metaSiteVars->identity[$setupField]), |
|
| 210 | + 'value' => (int) !empty($metaBundle->metaSiteVars->identity[$setupField]), |
|
| 211 | 211 | ]; |
| 212 | 212 | } |
| 213 | 213 | $stat = round(($stat / $numFields) * 100); |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $variables['title'] = $templateTitle; |
| 256 | 256 | $variables['subSectionTitle'] = $subSectionTitle; |
| 257 | 257 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
| 258 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 258 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 259 | 259 | $variables['crumbs'] = [ |
| 260 | 260 | [ |
| 261 | 261 | 'label' => $pluginName, |
@@ -263,11 +263,11 @@ discard block |
||
| 263 | 263 | ], |
| 264 | 264 | [ |
| 265 | 265 | 'label' => $templateTitle, |
| 266 | - 'url' => UrlHelper::cpUrl('seomatic/global/general' . $siteHandleUri), |
|
| 266 | + 'url' => UrlHelper::cpUrl('seomatic/global/general'.$siteHandleUri), |
|
| 267 | 267 | ], |
| 268 | 268 | [ |
| 269 | 269 | 'label' => $subSectionTitle, |
| 270 | - 'url' => UrlHelper::cpUrl('seomatic/global/' . $subSection . $siteHandleUri), |
|
| 270 | + 'url' => UrlHelper::cpUrl('seomatic/global/'.$subSection.$siteHandleUri), |
|
| 271 | 271 | ], |
| 272 | 272 | ]; |
| 273 | 273 | $variables['selectedSubnavItem'] = 'global'; |
@@ -275,14 +275,14 @@ discard block |
||
| 275 | 275 | $this->setGlobalFieldSourceVariables($variables); |
| 276 | 276 | // Enabled sites |
| 277 | 277 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
| 278 | - $variables['controllerHandle'] = 'global' . '/' . $subSection; |
|
| 278 | + $variables['controllerHandle'] = 'global'.'/'.$subSection; |
|
| 279 | 279 | $variables['currentSubSection'] = $subSection; |
| 280 | 280 | // Meta bundle settings |
| 281 | 281 | Seomatic::$previewingMetaContainers = true; |
| 282 | 282 | // Get the site to copy the settings from, if any |
| 283 | 283 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
| 284 | 284 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
| 285 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
| 285 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
| 286 | 286 | // Load the metabundle |
| 287 | 287 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
| 288 | 288 | if ($editedMetaBundle) { |
@@ -336,11 +336,11 @@ discard block |
||
| 336 | 336 | // Preview the meta containers |
| 337 | 337 | Seomatic::$plugin->metaContainers->previewMetaContainers( |
| 338 | 338 | MetaBundles::GLOBAL_META_BUNDLE, |
| 339 | - (int)$variables['currentSiteId'] |
|
| 339 | + (int) $variables['currentSiteId'] |
|
| 340 | 340 | ); |
| 341 | 341 | |
| 342 | 342 | // Render the template |
| 343 | - return $this->renderTemplate('seomatic/settings/global/' . $subSection, $variables); |
|
| 343 | + return $this->renderTemplate('seomatic/settings/global/'.$subSection, $variables); |
|
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | /** |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | $variables['pluginName'] = Seomatic::$settings->pluginName; |
| 473 | 473 | $variables['title'] = $templateTitle; |
| 474 | 474 | $variables['docTitle'] = "{$pluginName} - {$templateTitle}"; |
| 475 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 475 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 476 | 476 | $variables['crumbs'] = [ |
| 477 | 477 | [ |
| 478 | 478 | 'label' => $pluginName, |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | ], |
| 481 | 481 | [ |
| 482 | 482 | 'label' => $templateTitle, |
| 483 | - 'url' => UrlHelper::cpUrl('seomatic/content' . $siteHandleUri), |
|
| 483 | + 'url' => UrlHelper::cpUrl('seomatic/content'.$siteHandleUri), |
|
| 484 | 484 | ], |
| 485 | 485 | ]; |
| 486 | 486 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | $siteHandle = $this->getCpSiteHandle($siteHandle); |
| 522 | 522 | $siteId = $this->getSiteIdFromHandle($siteHandle); |
| 523 | 523 | if (is_string($typeId)) { |
| 524 | - $typeId = (int)$typeId; |
|
| 524 | + $typeId = (int) $typeId; |
|
| 525 | 525 | } |
| 526 | 526 | if (empty($typeId)) { |
| 527 | 527 | $typeId = null; |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | $currentType = reset($typeMenu); |
| 540 | 540 | $variables['currentType'] = $typeMenu[$typeId] ?? $currentType; |
| 541 | 541 | $variables['currentTypeId'] = $typeId ?? key($typeMenu); |
| 542 | - $typeId = (int)$variables['currentTypeId']; |
|
| 542 | + $typeId = (int) $variables['currentTypeId']; |
|
| 543 | 543 | } |
| 544 | 544 | // If there's only one EntryType, don't bother displaying the menu |
| 545 | 545 | if (count($typeMenu) === 1) { |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | // Get the site to copy the settings from, if any |
| 572 | 572 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
| 573 | 573 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
| 574 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
| 574 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
| 575 | 575 | // Load the metabundle |
| 576 | 576 | $metaBundle = Seomatic::$plugin->metaBundles->getMetaBundleBySourceHandle( |
| 577 | 577 | $sourceBundleType, |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | $variables['title'] = $templateTitle; |
| 598 | 598 | $variables['subSectionTitle'] = $subSectionTitle; |
| 599 | 599 | $variables['docTitle'] = "{$pluginName} - Content SEO - {$templateTitle} - {$subSectionTitle}"; |
| 600 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 600 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 601 | 601 | $variables['siteHandleUri'] = $siteHandleUri; |
| 602 | 602 | $variables['crumbs'] = [ |
| 603 | 603 | [ |
@@ -606,10 +606,10 @@ discard block |
||
| 606 | 606 | ], |
| 607 | 607 | [ |
| 608 | 608 | 'label' => 'Content SEO', |
| 609 | - 'url' => UrlHelper::cpUrl('seomatic/content' . $siteHandleUri), |
|
| 609 | + 'url' => UrlHelper::cpUrl('seomatic/content'.$siteHandleUri), |
|
| 610 | 610 | ], |
| 611 | 611 | [ |
| 612 | - 'label' => $metaBundle->sourceName . ' · ' . $subSectionTitle, |
|
| 612 | + 'label' => $metaBundle->sourceName.' · '.$subSectionTitle, |
|
| 613 | 613 | 'url' => UrlHelper::cpUrl("seomatic/edit-content/${subSection}/${sourceBundleType}/${sourceHandle}"), |
| 614 | 614 | ], |
| 615 | 615 | ]; |
@@ -639,13 +639,13 @@ discard block |
||
| 639 | 639 | // Preview the meta containers |
| 640 | 640 | Seomatic::$plugin->metaContainers->previewMetaContainers( |
| 641 | 641 | $uri, |
| 642 | - (int)$variables['currentSiteId'], |
|
| 642 | + (int) $variables['currentSiteId'], |
|
| 643 | 643 | false, |
| 644 | 644 | false |
| 645 | 645 | ); |
| 646 | 646 | |
| 647 | 647 | // Render the template |
| 648 | - return $this->renderTemplate('seomatic/settings/content/' . $subSection, $variables); |
|
| 648 | + return $this->renderTemplate('seomatic/settings/content/'.$subSection, $variables); |
|
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | /** |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | $bundleSettings = $request->getParam('metaBundleSettings'); |
| 667 | 667 | $sitemapSettings = $request->getParam('metaSitemapVars'); |
| 668 | 668 | if (is_string($typeId)) { |
| 669 | - $typeId = (int)$typeId; |
|
| 669 | + $typeId = (int) $typeId; |
|
| 670 | 670 | } |
| 671 | 671 | // Set the element type in the template |
| 672 | 672 | $elementName = ''; |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | if ($subSection === 'social') { |
| 739 | 739 | $subSectionSuffix = ' Media'; |
| 740 | 740 | } |
| 741 | - $subSectionTitle = Craft::t('seomatic', ucfirst($subSection) . $subSectionSuffix); |
|
| 741 | + $subSectionTitle = Craft::t('seomatic', ucfirst($subSection).$subSectionSuffix); |
|
| 742 | 742 | // Asset bundle |
| 743 | 743 | try { |
| 744 | 744 | Seomatic::$view->registerAssetBundle(SeomaticAsset::class); |
@@ -756,7 +756,7 @@ discard block |
||
| 756 | 756 | $variables['title'] = $templateTitle; |
| 757 | 757 | $variables['subSectionTitle'] = $subSectionTitle; |
| 758 | 758 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
| 759 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 759 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 760 | 760 | $variables['crumbs'] = [ |
| 761 | 761 | [ |
| 762 | 762 | 'label' => $pluginName, |
@@ -764,11 +764,11 @@ discard block |
||
| 764 | 764 | ], |
| 765 | 765 | [ |
| 766 | 766 | 'label' => $templateTitle, |
| 767 | - 'url' => UrlHelper::cpUrl('seomatic/site/identity' . $siteHandleUri), |
|
| 767 | + 'url' => UrlHelper::cpUrl('seomatic/site/identity'.$siteHandleUri), |
|
| 768 | 768 | ], |
| 769 | 769 | [ |
| 770 | 770 | 'label' => $subSectionTitle, |
| 771 | - 'url' => UrlHelper::cpUrl('seomatic/site/' . $subSection . $siteHandleUri), |
|
| 771 | + 'url' => UrlHelper::cpUrl('seomatic/site/'.$subSection.$siteHandleUri), |
|
| 772 | 772 | ], |
| 773 | 773 | ]; |
| 774 | 774 | $variables['selectedSubnavItem'] = 'site'; |
@@ -776,14 +776,14 @@ discard block |
||
| 776 | 776 | |
| 777 | 777 | // Enabled sites |
| 778 | 778 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
| 779 | - $variables['controllerHandle'] = 'site' . '/' . $subSection; |
|
| 779 | + $variables['controllerHandle'] = 'site'.'/'.$subSection; |
|
| 780 | 780 | |
| 781 | 781 | // The site settings for the appropriate meta bundle |
| 782 | 782 | Seomatic::$previewingMetaContainers = true; |
| 783 | 783 | // Get the site to copy the settings from, if any |
| 784 | 784 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
| 785 | 785 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
| 786 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
| 786 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
| 787 | 787 | // Load the metabundle |
| 788 | 788 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
| 789 | 789 | Seomatic::$previewingMetaContainers = false; |
@@ -801,7 +801,7 @@ discard block |
||
| 801 | 801 | $variables['elementType'] = Asset::class; |
| 802 | 802 | |
| 803 | 803 | // Render the template |
| 804 | - return $this->renderTemplate('seomatic/settings/site/' . $subSection, $variables); |
|
| 804 | + return $this->renderTemplate('seomatic/settings/site/'.$subSection, $variables); |
|
| 805 | 805 | } |
| 806 | 806 | |
| 807 | 807 | /** |
@@ -933,7 +933,7 @@ discard block |
||
| 933 | 933 | $siteId = $this->getSiteIdFromHandle($siteHandle); |
| 934 | 934 | // Enabled sites |
| 935 | 935 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
| 936 | - $variables['controllerHandle'] = 'tracking' . '/' . $subSection; |
|
| 936 | + $variables['controllerHandle'] = 'tracking'.'/'.$subSection; |
|
| 937 | 937 | $variables['currentSubSection'] = $subSection; |
| 938 | 938 | |
| 939 | 939 | // The script meta containers for the global meta bundle |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | // Get the site to copy the settings from, if any |
| 942 | 942 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
| 943 | 943 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
| 944 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
| 944 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
| 945 | 945 | // Load the metabundle |
| 946 | 946 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
| 947 | 947 | if ($editedMetaBundle) { |
@@ -981,7 +981,7 @@ discard block |
||
| 981 | 981 | $variables['title'] = $templateTitle; |
| 982 | 982 | $variables['subSectionTitle'] = $subSectionTitle; |
| 983 | 983 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
| 984 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 984 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 985 | 985 | $variables['crumbs'] = [ |
| 986 | 986 | [ |
| 987 | 987 | 'label' => $pluginName, |
@@ -993,7 +993,7 @@ discard block |
||
| 993 | 993 | ], |
| 994 | 994 | [ |
| 995 | 995 | 'label' => $subSectionTitle, |
| 996 | - 'url' => UrlHelper::cpUrl('seomatic/tracking/' . $subSection . $siteHandleUri), |
|
| 996 | + 'url' => UrlHelper::cpUrl('seomatic/tracking/'.$subSection.$siteHandleUri), |
|
| 997 | 997 | ], |
| 998 | 998 | ]; |
| 999 | 999 | $variables['selectedSubnavItem'] = 'tracking'; |
@@ -1146,7 +1146,7 @@ discard block |
||
| 1146 | 1146 | if ($siteHandle !== null) { |
| 1147 | 1147 | $site = Craft::$app->getSites()->getSiteByHandle($siteHandle); |
| 1148 | 1148 | if (!$site) { |
| 1149 | - throw new NotFoundHttpException('Invalid site handle: ' . $siteHandle); |
|
| 1149 | + throw new NotFoundHttpException('Invalid site handle: '.$siteHandle); |
|
| 1150 | 1150 | } |
| 1151 | 1151 | $siteId = $site->id; |
| 1152 | 1152 | } else { |
@@ -1183,7 +1183,7 @@ discard block |
||
| 1183 | 1183 | if (!empty($variables['enabledSiteIds'])) { |
| 1184 | 1184 | $siteId = reset($variables['enabledSiteIds']); |
| 1185 | 1185 | } else { |
| 1186 | - $this->requirePermission('editSite:' . $siteId); |
|
| 1186 | + $this->requirePermission('editSite:'.$siteId); |
|
| 1187 | 1187 | } |
| 1188 | 1188 | } |
| 1189 | 1189 | } |
@@ -1203,7 +1203,7 @@ discard block |
||
| 1203 | 1203 | if ($variables['showSites']) { |
| 1204 | 1204 | $variables['sitesMenuLabel'] = Craft::t( |
| 1205 | 1205 | 'site', |
| 1206 | - $sites->getSiteById((int)$variables['currentSiteId'])->name |
|
| 1206 | + $sites->getSiteById((int) $variables['currentSiteId'])->name |
|
| 1207 | 1207 | ); |
| 1208 | 1208 | } else { |
| 1209 | 1209 | $variables['sitesMenuLabel'] = ''; |
@@ -1270,7 +1270,7 @@ discard block |
||
| 1270 | 1270 | $typeId = null, |
| 1271 | 1271 | ) { |
| 1272 | 1272 | $variables['textFieldSources'] = array_merge( |
| 1273 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'], |
|
| 1273 | + ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'], |
|
| 1274 | 1274 | FieldHelper::fieldsOfTypeFromSource( |
| 1275 | 1275 | $sourceBundleType, |
| 1276 | 1276 | $sourceHandle, |
@@ -1280,7 +1280,7 @@ discard block |
||
| 1280 | 1280 | ) |
| 1281 | 1281 | ); |
| 1282 | 1282 | $variables['assetFieldSources'] = array_merge( |
| 1283 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields']], |
|
| 1283 | + ['entryGroup' => ['optgroup' => $groupName.' Fields']], |
|
| 1284 | 1284 | FieldHelper::fieldsOfTypeFromSource( |
| 1285 | 1285 | $sourceBundleType, |
| 1286 | 1286 | $sourceHandle, |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | * @param MetaBundle $metaBundle |
| 195 | 195 | * @param bool $forceUpdate |
| 196 | 196 | */ |
| 197 | - public function syncBundleWithConfig(MetaBundle &$metaBundle, bool $forceUpdate = false) |
|
| 197 | + public function syncBundleWithConfig(MetaBundle & $metaBundle, bool $forceUpdate = false) |
|
| 198 | 198 | { |
| 199 | 199 | $prevMetaBundle = $metaBundle; |
| 200 | 200 | $config = []; |
@@ -275,8 +275,8 @@ discard block |
||
| 275 | 275 | */ |
| 276 | 276 | public function updateMetaBundle(MetaBundle $metaBundle, int $siteId) |
| 277 | 277 | { |
| 278 | - $metaBundle->sourceName = (string)$metaBundle->sourceName; |
|
| 279 | - $metaBundle->sourceTemplate = (string)$metaBundle->sourceTemplate; |
|
| 278 | + $metaBundle->sourceName = (string) $metaBundle->sourceName; |
|
| 279 | + $metaBundle->sourceTemplate = (string) $metaBundle->sourceTemplate; |
|
| 280 | 280 | // Make sure it validates |
| 281 | 281 | if ($metaBundle->validate(null, true)) { |
| 282 | 282 | // Save it out to a record |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | 'sourceSiteId' => $siteId, |
| 287 | 287 | ]; |
| 288 | 288 | if ($metaBundle->typeId !== null) { |
| 289 | - $metaBundle->typeId = (int)$metaBundle->typeId; |
|
| 289 | + $metaBundle->typeId = (int) $metaBundle->typeId; |
|
| 290 | 290 | } |
| 291 | 291 | if (!empty($metaBundle->typeId)) { |
| 292 | 292 | $params['typeId'] = $metaBundle->typeId; |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | // The issue was that the containers were getting saved to the db with a hard-coded setting in them, because they'd |
| 304 | 304 | // been set that way by the environment, whereas to be changeable via the GUI, it needs to be set to {seomatic.meta.robots} |
| 305 | 305 | /** @var RobotsTag|null $robotsTag */ |
| 306 | - $robotsTag = $metaBundle->metaContainers[MetaTagContainer::CONTAINER_TYPE . TagService::GENERAL_HANDLE]->data['robots'] ?? null; |
|
| 306 | + $robotsTag = $metaBundle->metaContainers[MetaTagContainer::CONTAINER_TYPE.TagService::GENERAL_HANDLE]->data['robots'] ?? null; |
|
| 307 | 307 | if (!empty($robotsTag)) { |
| 308 | 308 | $robotsTag->content = $robotsTag->environment['live']['content'] ?? '{{ seomatic.meta.robots }}'; |
| 309 | 309 | } |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | $metaBundleDefaults = ArrayHelper::merge( |
| 385 | 385 | $seoElement::metaBundleConfig($sourceModel), |
| 386 | 386 | [ |
| 387 | - 'sourceTemplate' => (string)$siteSetting->template, |
|
| 387 | + 'sourceTemplate' => (string) $siteSetting->template, |
|
| 388 | 388 | 'sourceSiteId' => $siteSetting->siteId, |
| 389 | 389 | 'sourceAltSiteSettings' => $siteSettingsArray, |
| 390 | 390 | 'sourceDateUpdated' => $dateUpdated, |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | public function getMetaBundleBySourceHandle(string $sourceBundleType, string $sourceHandle, int $sourceSiteId, $typeId = null) |
| 434 | 434 | { |
| 435 | 435 | $metaBundle = null; |
| 436 | - $typeId = (int)$typeId; |
|
| 436 | + $typeId = (int) $typeId; |
|
| 437 | 437 | // See if we have the meta bundle cached |
| 438 | 438 | if (!empty($this->metaBundlesBySourceHandle[$sourceBundleType][$sourceHandle][$sourceSiteId][$typeId])) { |
| 439 | 439 | $id = $this->metaBundlesBySourceHandle[$sourceBundleType][$sourceHandle][$sourceSiteId][$typeId]; |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | /** @var Section|CategoryGroup|ProductType $sourceModel */ |
| 521 | 521 | $sourceModel = $seoElement::sourceModelFromId($sourceId); |
| 522 | 522 | if ($sourceModel !== null) { |
| 523 | - $metaBundle->sourceName = (string)$sourceModel->name; |
|
| 523 | + $metaBundle->sourceName = (string) $sourceModel->name; |
|
| 524 | 524 | $metaBundle->sourceHandle = $sourceModel->handle; |
| 525 | 525 | } |
| 526 | 526 | } |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | public function getMetaBundleBySourceId(string $sourceBundleType, int $sourceId, ?int $sourceSiteId, $typeId = null) |
| 562 | 562 | { |
| 563 | 563 | $metaBundle = null; |
| 564 | - $typeId = (int)$typeId; |
|
| 564 | + $typeId = (int) $typeId; |
|
| 565 | 565 | // See if we have the meta bundle cached |
| 566 | 566 | if (!empty($this->metaBundlesBySourceId[$sourceBundleType][$sourceId][$sourceSiteId][$typeId])) { |
| 567 | 567 | $id = $this->metaBundlesBySourceId[$sourceBundleType][$sourceId][$sourceSiteId][$typeId]; |
@@ -753,7 +753,7 @@ discard block |
||
| 753 | 753 | ->from(['{{%seomatic_metabundles}}']) |
| 754 | 754 | ->where(['=', 'sourceBundleType', $seoElement::META_BUNDLE_TYPE]); |
| 755 | 755 | |
| 756 | - if ((int)$sourceSiteId !== 0) { |
|
| 756 | + if ((int) $sourceSiteId !== 0) { |
|
| 757 | 757 | $subQuery->andWhere(['sourceSiteId' => $sourceSiteId]); |
| 758 | 758 | } |
| 759 | 759 | if ($filter !== '') { |
@@ -790,7 +790,7 @@ discard block |
||
| 790 | 790 | public function getContentMetaBundleForElement(Element $element) |
| 791 | 791 | { |
| 792 | 792 | $source = $this->getMetaSourceFromElement($element); |
| 793 | - $key = implode(".", $source) . '.' . $element->siteId; |
|
| 793 | + $key = implode(".", $source).'.'.$element->siteId; |
|
| 794 | 794 | |
| 795 | 795 | if (empty($this->elementContentMetaBundles[$key])) { |
| 796 | 796 | $this->elementContentMetaBundles[$key] = $this->getMetaBundleBySourceId($source[1], $source[0], $element->siteId, $source[4]); |
@@ -812,10 +812,10 @@ discard block |
||
| 812 | 812 | $seoSettingsField = Craft::$app->getFields()->getFieldByHandle($fieldHandle); |
| 813 | 813 | if ($seoSettingsField) { |
| 814 | 814 | $seoSettingsEnabledFields = array_flip(array_merge( |
| 815 | - (array)$seoSettingsField->generalEnabledFields, |
|
| 816 | - (array)$seoSettingsField->twitterEnabledFields, |
|
| 817 | - (array)$seoSettingsField->facebookEnabledFields, |
|
| 818 | - (array)$seoSettingsField->sitemapEnabledFields |
|
| 815 | + (array) $seoSettingsField->generalEnabledFields, |
|
| 816 | + (array) $seoSettingsField->twitterEnabledFields, |
|
| 817 | + (array) $seoSettingsField->facebookEnabledFields, |
|
| 818 | + (array) $seoSettingsField->sitemapEnabledFields |
|
| 819 | 819 | )); |
| 820 | 820 | // Always include some fields, as they are calculated even if not explicitly included |
| 821 | 821 | $seoSettingsEnabledFields = array_merge( |
@@ -843,7 +843,7 @@ discard block |
||
| 843 | 843 | |
| 844 | 844 | |
| 845 | 845 | // Handle the mainEntityOfPage |
| 846 | - if (!in_array('mainEntityOfPage', (array)$seoSettingsField->generalEnabledFields, false)) { |
|
| 846 | + if (!in_array('mainEntityOfPage', (array) $seoSettingsField->generalEnabledFields, false)) { |
|
| 847 | 847 | $metaBundle->metaGlobalVars->mainEntityOfPage = ''; |
| 848 | 848 | } |
| 849 | 849 | // metaSiteVars |