@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | /** |
| 161 | 161 | * @inheritdoc |
| 162 | 162 | */ |
| 163 | - public function getContentColumnType(): array|string |
|
| 163 | + public function getContentColumnType(): array | string |
|
| 164 | 164 | { |
| 165 | 165 | return Schema::TYPE_TEXT; |
| 166 | 166 | } |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | } |
| 232 | 232 | // Handle the mainEntityOfPage |
| 233 | 233 | $mainEntity = ''; |
| 234 | - if (in_array('mainEntityOfPage', (array)$this->generalEnabledFields, false) && |
|
| 234 | + if (in_array('mainEntityOfPage', (array) $this->generalEnabledFields, false) && |
|
| 235 | 235 | !empty($config['metaBundleSettings'])) { |
| 236 | 236 | $mainEntity = SchemaHelper::getSpecificEntityType($config['metaBundleSettings'], true); |
| 237 | 237 | } |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | $value = StringHelper::encodeMb4($value); |
| 262 | 262 | } |
| 263 | 263 | if (is_array($value)) { |
| 264 | - array_walk_recursive($value, function (&$arrayValue, $arrayKey) { |
|
| 264 | + array_walk_recursive($value, function(&$arrayValue, $arrayKey) { |
|
| 265 | 265 | if ($arrayValue !== null && is_string($arrayValue)) { |
| 266 | 266 | $arrayValue = StringHelper::encodeMb4($arrayValue); |
| 267 | 267 | } |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | if ($element !== null && $element->uri !== null) { |
| 398 | 398 | $siteId = $element->siteId; |
| 399 | 399 | $uri = $element->uri; |
| 400 | - $cacheKey = self::CACHE_KEY . $uri . $siteId . $this->elementDisplayPreviewType; |
|
| 400 | + $cacheKey = self::CACHE_KEY.$uri.$siteId.$this->elementDisplayPreviewType; |
|
| 401 | 401 | $metaBundleSourceType = Seomatic::$plugin->seoElements->getMetaBundleTypeFromElement($element); |
| 402 | 402 | $seoElement = Seomatic::$plugin->seoElements->getSeoElementByMetaBundleType($metaBundleSourceType); |
| 403 | 403 | $metaBundleSourceType = SeoEntry::getMetaBundleType(); |
@@ -408,15 +408,15 @@ discard block |
||
| 408 | 408 | $dependency = new TagDependency([ |
| 409 | 409 | 'tags' => [ |
| 410 | 410 | MetaContainers::GLOBAL_METACONTAINER_CACHE_TAG, |
| 411 | - MetaContainers::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId, |
|
| 412 | - MetaContainers::METACONTAINER_CACHE_TAG . $uri . $siteId, |
|
| 411 | + MetaContainers::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId, |
|
| 412 | + MetaContainers::METACONTAINER_CACHE_TAG.$uri.$siteId, |
|
| 413 | 413 | ], |
| 414 | 414 | ]); |
| 415 | 415 | $cache = Craft::$app->getCache(); |
| 416 | 416 | $cacheDuration = null; |
| 417 | 417 | $html = $cache->getOrSet( |
| 418 | - self::CACHE_KEY . $cacheKey, |
|
| 419 | - function () use ($uri, $siteId, $element) { |
|
| 418 | + self::CACHE_KEY.$cacheKey, |
|
| 419 | + function() use ($uri, $siteId, $element) { |
|
| 420 | 420 | Seomatic::$plugin->metaContainers->previewMetaContainers($uri, $siteId, true); |
| 421 | 421 | $variables = [ |
| 422 | 422 | 'previewTypes' => [ |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | ) |
| 459 | 459 | { |
| 460 | 460 | $variables['textFieldSources'] = array_merge( |
| 461 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'], |
|
| 461 | + ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'], |
|
| 462 | 462 | FieldHelper::fieldsOfTypeFromElement( |
| 463 | 463 | $element, |
| 464 | 464 | FieldHelper::TEXT_FIELD_CLASS_KEY, |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | ) |
| 467 | 467 | ); |
| 468 | 468 | $variables['assetFieldSources'] = array_merge( |
| 469 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields']], |
|
| 469 | + ['entryGroup' => ['optgroup' => $groupName.' Fields']], |
|
| 470 | 470 | FieldHelper::fieldsOfTypeFromElement( |
| 471 | 471 | $element, |
| 472 | 472 | FieldHelper::ASSET_FIELD_CLASS_KEY, |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | // Output some info if this is a console app |
| 81 | 81 | if ($job && Craft::$app instanceof ConsoleApplication) { |
| 82 | - echo $job->description . PHP_EOL; |
|
| 82 | + echo $job->description.PHP_EOL; |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | $lines = []; |
@@ -139,8 +139,8 @@ discard block |
||
| 139 | 139 | while ($currentElement < $totalElements) { |
| 140 | 140 | $elements = $paginator->getPageResults(); |
| 141 | 141 | if (Craft::$app instanceof ConsoleApplication) { |
| 142 | - echo 'Query ' . $paginator->getCurrentPage() . '/' . $paginator->getTotalPages() |
|
| 143 | - . ' - elements: ' . $paginator->getTotalResults() |
|
| 142 | + echo 'Query '.$paginator->getCurrentPage().'/'.$paginator->getTotalPages() |
|
| 143 | + . ' - elements: '.$paginator->getTotalResults() |
|
| 144 | 144 | . PHP_EOL; |
| 145 | 145 | } |
| 146 | 146 | /** @var ElementInterface $element */ |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | // Output some info if this is a console app |
| 154 | 154 | if (Craft::$app instanceof ConsoleApplication) { |
| 155 | - echo "Processing element {$currentElement}/{$totalElements} - {$element->title}" . PHP_EOL; |
|
| 155 | + echo "Processing element {$currentElement}/{$totalElements} - {$element->title}".PHP_EOL; |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | $metaBundle->metaSitemapVars->setAttributes($stashedSitemapAttrs, false); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | } |
| 190 | 190 | $canonicalUrl = UrlHelper::absoluteUrlWithProtocol($canonicalUrl); |
| 191 | 191 | if ($url !== $canonicalUrl) { |
| 192 | - Craft::info("Excluding URL: {$url} from the sitemap because it does not match the Canonical URL: {$canonicalUrl} - " . $metaBundle->metaGlobalVars->canonicalUrl . " - " . $element->uri); |
|
| 192 | + Craft::info("Excluding URL: {$url} from the sitemap because it does not match the Canonical URL: {$canonicalUrl} - ".$metaBundle->metaGlobalVars->canonicalUrl." - ".$element->uri); |
|
| 193 | 193 | continue; |
| 194 | 194 | } |
| 195 | 195 | } |
@@ -241,12 +241,12 @@ discard block |
||
| 241 | 241 | if ($primarySiteId === $altSourceSiteId && Seomatic::$settings->addXDefaultHrefLang) { |
| 242 | 242 | $lines[] = '<xhtml:link rel="alternate"' |
| 243 | 243 | . ' hreflang="x-default"' |
| 244 | - . ' href="' . Html::encode($altUrl) . '"' |
|
| 244 | + . ' href="'.Html::encode($altUrl).'"' |
|
| 245 | 245 | . ' />'; |
| 246 | 246 | } |
| 247 | 247 | $lines[] = '<xhtml:link rel="alternate"' |
| 248 | - . ' hreflang="' . $altSiteSettings['language'] . '"' |
|
| 249 | - . ' href="' . Html::encode($altUrl) . '"' |
|
| 248 | + . ' hreflang="'.$altSiteSettings['language'].'"' |
|
| 249 | + . ' href="'.Html::encode($altUrl).'"' |
|
| 250 | 250 | . ' />'; |
| 251 | 251 | } |
| 252 | 252 | } |
@@ -346,11 +346,11 @@ discard block |
||
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | $cache = Craft::$app->getCache(); |
| 349 | - $cacheKey = SitemapTemplate::CACHE_KEY . $groupId . $type . $handle . $siteId; |
|
| 349 | + $cacheKey = SitemapTemplate::CACHE_KEY.$groupId.$type.$handle.$siteId; |
|
| 350 | 350 | $dependency = new TagDependency([ |
| 351 | 351 | 'tags' => [ |
| 352 | 352 | SitemapTemplate::GLOBAL_SITEMAP_CACHE_TAG, |
| 353 | - SitemapTemplate::SITEMAP_CACHE_TAG . $handle . $siteId, |
|
| 353 | + SitemapTemplate::SITEMAP_CACHE_TAG.$handle.$siteId, |
|
| 354 | 354 | ], |
| 355 | 355 | ]); |
| 356 | 356 | $lines = implode('', $lines); |
@@ -363,10 +363,10 @@ discard block |
||
| 363 | 363 | $result = $cache->set($cacheKey, $lines, $cacheDuration, $dependency); |
| 364 | 364 | // Remove the queue job id from the cache too |
| 365 | 365 | $cache->delete($queueJobCacheKey); |
| 366 | - Craft::debug('Sitemap cache result: ' . print_r($result, true) . ' for cache key: ' . $cacheKey, __METHOD__); |
|
| 366 | + Craft::debug('Sitemap cache result: '.print_r($result, true).' for cache key: '.$cacheKey, __METHOD__); |
|
| 367 | 367 | // Output some info if this is a console app |
| 368 | 368 | if (Craft::$app instanceof ConsoleApplication) { |
| 369 | - echo 'Sitemap cache result: ' . print_r($result, true) . ' for cache key: ' . $cacheKey . PHP_EOL; |
|
| 369 | + echo 'Sitemap cache result: '.print_r($result, true).' for cache key: '.$cacheKey.PHP_EOL; |
|
| 370 | 370 | } |
| 371 | 371 | // If the FastCGI Cache Bust plugin is installed, clear its caches too |
| 372 | 372 | $plugin = Craft::$app->getPlugins()->getPlugin('fastcgi-cache-bust'); |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | |
| 447 | 447 | $attributes = \array_intersect_key( |
| 448 | 448 | $attributes, |
| 449 | - array_flip((array)$seoSettingsField->sitemapEnabledFields) |
|
| 449 | + array_flip((array) $seoSettingsField->sitemapEnabledFields) |
|
| 450 | 450 | ); |
| 451 | 451 | $attributes = array_filter( |
| 452 | 452 | $attributes, |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | */ |
| 479 | 479 | protected static function assetSitemapItem(Asset $asset, MetaBundle $metaBundle, array &$lines) |
| 480 | 480 | { |
| 481 | - if ((bool)$asset->enabledForSite && $asset->getUrl() !== null) { |
|
| 481 | + if ((bool) $asset->enabledForSite && $asset->getUrl() !== null) { |
|
| 482 | 482 | switch ($asset->kind) { |
| 483 | 483 | case 'image': |
| 484 | 484 | $lines[] = '<image:image>'; |
@@ -490,9 +490,9 @@ discard block |
||
| 490 | 490 | $fieldName = $row['field'] ?? ''; |
| 491 | 491 | $propName = $row['property'] ?? ''; |
| 492 | 492 | if (!empty($asset[$fieldName]) && !empty($propName)) { |
| 493 | - $lines[] = '<image:' . $propName . '>'; |
|
| 493 | + $lines[] = '<image:'.$propName.'>'; |
|
| 494 | 494 | $lines[] = Html::encode($asset[$fieldName]); |
| 495 | - $lines[] = '</image:' . $propName . '>'; |
|
| 495 | + $lines[] = '</image:'.$propName.'>'; |
|
| 496 | 496 | } |
| 497 | 497 | } |
| 498 | 498 | $lines[] = '</image:image>'; |
@@ -508,9 +508,9 @@ discard block |
||
| 508 | 508 | $fieldName = $row['field'] ?? ''; |
| 509 | 509 | $propName = $row['property'] ?? ''; |
| 510 | 510 | if (!empty($asset[$fieldName]) && !empty($propName)) { |
| 511 | - $lines[] = '<video:' . $propName . '>'; |
|
| 511 | + $lines[] = '<video:'.$propName.'>'; |
|
| 512 | 512 | $lines[] = Html::encode($asset[$fieldName]); |
| 513 | - $lines[] = '</video:' . $propName . '>'; |
|
| 513 | + $lines[] = '</video:'.$propName.'>'; |
|
| 514 | 514 | } |
| 515 | 515 | } |
| 516 | 516 | $lines[] = '</video:video>'; |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | */ |
| 527 | 527 | protected static function assetFilesSitemapLink(Asset $asset, MetaBundle $metaBundle, array &$lines) |
| 528 | 528 | { |
| 529 | - if ((bool)$asset->enabledForSite && $asset->getUrl() !== null) { |
|
| 529 | + if ((bool) $asset->enabledForSite && $asset->getUrl() !== null) { |
|
| 530 | 530 | if (\in_array($asset->kind, SitemapTemplate::FILE_TYPES, false)) { |
| 531 | 531 | $dateUpdated = $asset->dateUpdated ?? $asset->dateCreated ?? new \DateTime; |
| 532 | 532 | $lines[] = '<url>'; |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | { |
| 85 | 85 | if ($pageInfo !== null && $pageInfo->currentPage !== null) { |
| 86 | 86 | // Let the meta containers know that this page is paginated |
| 87 | - Seomatic::$plugin->metaContainers->paginationPage = (string)$pageInfo->currentPage; |
|
| 87 | + Seomatic::$plugin->metaContainers->paginationPage = (string) $pageInfo->currentPage; |
|
| 88 | 88 | // See if we should strip the query params |
| 89 | 89 | $stripQueryParams = true; |
| 90 | 90 | $pageTrigger = Craft::$app->getConfig()->getGeneral()->pageTrigger; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | if (is_array($content)) { |
| 158 | 158 | $headerValue = ''; |
| 159 | 159 | foreach ($content as $contentVal) { |
| 160 | - $headerValue .= ($contentVal . ','); |
|
| 160 | + $headerValue .= ($contentVal.','); |
|
| 161 | 161 | } |
| 162 | 162 | $headerValue = rtrim($headerValue, ','); |
| 163 | 163 | } else { |
@@ -176,11 +176,11 @@ discard block |
||
| 176 | 176 | if (is_array($href)) { |
| 177 | 177 | $headerValue = ''; |
| 178 | 178 | foreach ($href as $hrefVal) { |
| 179 | - $headerValue .= ('<' . $hrefVal . '>' . ','); |
|
| 179 | + $headerValue .= ('<'.$hrefVal.'>'.','); |
|
| 180 | 180 | } |
| 181 | 181 | $headerValue = rtrim($headerValue, ','); |
| 182 | 182 | } else { |
| 183 | - $headerValue = '<' . $href . '>'; |
|
| 183 | + $headerValue = '<'.$href.'>'; |
|
| 184 | 184 | } |
| 185 | 185 | $headerValue .= "; rel='canonical'"; |
| 186 | 186 | $response->headers->add('Link', $headerValue); |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | if (is_array($content)) { |
| 197 | 197 | $headerValue = ''; |
| 198 | 198 | foreach ($content as $contentVal) { |
| 199 | - $headerValue .= ($contentVal . ','); |
|
| 199 | + $headerValue .= ($contentVal.','); |
|
| 200 | 200 | } |
| 201 | 201 | $headerValue = rtrim($headerValue, ','); |
| 202 | 202 | } else { |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | if ($lastElement && $element) { |
| 383 | 383 | if ($lastElement->uri !== '__home__' && $element->uri) { |
| 384 | 384 | $path = $lastElement->uri; |
| 385 | - $segments = array_values(array_filter(explode('/', $path), function ($segment) { |
|
| 385 | + $segments = array_values(array_filter(explode('/', $path), function($segment) { |
|
| 386 | 386 | return $segment !== ''; |
| 387 | 387 | })); |
| 388 | 388 | } |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | $element = $elements->getElementByUri($url, $site->id, false); |
| 543 | 543 | } |
| 544 | 544 | if ($element !== null) { |
| 545 | - if (isset($element->enabledForSite) && !(bool)$element->enabledForSite) { |
|
| 545 | + if (isset($element->enabledForSite) && !(bool) $element->enabledForSite) { |
|
| 546 | 546 | $includeUrl = false; |
| 547 | 547 | } |
| 548 | 548 | /** @var MetaBundle $metaBundle */ |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | $seoSettingsField = Craft::$app->getFields()->getFieldByHandle($fieldHandle); |
| 577 | 577 | if ($fieldMetaBundle !== null && $seoSettingsField !== null && $seoSettingsField->sitemapTabEnabled) { |
| 578 | 578 | // If sitemaps are off for this entry, don't include the URL |
| 579 | - if (in_array('sitemapUrls', (array)$seoSettingsField->sitemapEnabledFields, false) |
|
| 579 | + if (in_array('sitemapUrls', (array) $seoSettingsField->sitemapEnabledFields, false) |
|
| 580 | 580 | && !$fieldMetaBundle->metaSitemapVars->sitemapUrls |
| 581 | 581 | && !Seomatic::$plugin->helper->isInherited($fieldMetaBundle->metaSitemapVars, 'sitemapUrls') |
| 582 | 582 | ) { |
@@ -795,7 +795,7 @@ discard block |
||
| 795 | 795 | if (isset($value[$day][$time]) |
| 796 | 796 | && ($date = DateTimeHelper::toDateTime($value[$day][$time])) !== false |
| 797 | 797 | ) { |
| 798 | - $normalized[$day][$time] = (array)($date); |
|
| 798 | + $normalized[$day][$time] = (array) ($date); |
|
| 799 | 799 | } else { |
| 800 | 800 | $normalized[$day][$time] = null; |
| 801 | 801 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | Event::on( |
| 109 | 109 | Sections::class, |
| 110 | 110 | Sections::EVENT_AFTER_SAVE_SECTION, |
| 111 | - function (SectionEvent $event) { |
|
| 111 | + function(SectionEvent $event) { |
|
| 112 | 112 | Craft::debug( |
| 113 | 113 | 'Sections::EVENT_AFTER_SAVE_SECTION', |
| 114 | 114 | __METHOD__ |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | Event::on( |
| 120 | 120 | Sections::class, |
| 121 | 121 | Sections::EVENT_AFTER_DELETE_SECTION, |
| 122 | - function (SectionEvent $event) { |
|
| 122 | + function(SectionEvent $event) { |
|
| 123 | 123 | Craft::debug( |
| 124 | 124 | 'Sections::EVENT_AFTER_DELETE_SECTION', |
| 125 | 125 | __METHOD__ |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | Event::on( |
| 135 | 135 | Sections::class, |
| 136 | 136 | Sections::EVENT_AFTER_SAVE_SECTION, |
| 137 | - function (SectionEvent $event) { |
|
| 137 | + function(SectionEvent $event) { |
|
| 138 | 138 | Craft::debug( |
| 139 | 139 | 'Sections::EVENT_AFTER_SAVE_SECTION', |
| 140 | 140 | __METHOD__ |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | Event::on( |
| 158 | 158 | Sections::class, |
| 159 | 159 | Sections::EVENT_AFTER_DELETE_SECTION, |
| 160 | - function (SectionEvent $event) { |
|
| 160 | + function(SectionEvent $event) { |
|
| 161 | 161 | Craft::debug( |
| 162 | 162 | 'Sections::EVENT_AFTER_DELETE_SECTION', |
| 163 | 163 | __METHOD__ |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | Event::on( |
| 187 | 187 | Entry::class, |
| 188 | 188 | Entry::EVENT_DEFINE_SIDEBAR_HTML, |
| 189 | - static function (DefineHtmlEvent $event) { |
|
| 189 | + static function(DefineHtmlEvent $event) { |
|
| 190 | 190 | Craft::debug( |
| 191 | 191 | 'Entry::EVENT_DEFINE_SIDEBAR_HTML', |
| 192 | 192 | __METHOD__ |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | ->limit($metaBundle->metaSitemapVars->sitemapLimit); |
| 228 | 228 | if ($metaBundle->sourceType === 'structure' |
| 229 | 229 | && !empty($metaBundle->metaSitemapVars->structureDepth)) { |
| 230 | - $query->level('<=' . $metaBundle->metaSitemapVars->structureDepth); |
|
| 230 | + $query->level('<='.$metaBundle->metaSitemapVars->structureDepth); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | return $query; |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
| 396 | 396 | [ |
| 397 | 397 | 'sourceId' => $sourceModel->id, |
| 398 | - 'sourceName' => (string)$sourceModel->name, |
|
| 398 | + 'sourceName' => (string) $sourceModel->name, |
|
| 399 | 399 | 'sourceHandle' => $sourceModel->handle, |
| 400 | 400 | 'sourceType' => $sourceModel->type, |
| 401 | 401 | ] |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | Event::on( |
| 107 | 107 | Categories::class, |
| 108 | 108 | Categories::EVENT_AFTER_SAVE_GROUP, |
| 109 | - function (CategoryGroupEvent $event) { |
|
| 109 | + function(CategoryGroupEvent $event) { |
|
| 110 | 110 | Craft::debug( |
| 111 | 111 | 'Categories::EVENT_AFTER_SAVE_GROUP', |
| 112 | 112 | __METHOD__ |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | Event::on( |
| 118 | 118 | Categories::class, |
| 119 | 119 | Categories::EVENT_AFTER_DELETE_GROUP, |
| 120 | - function (CategoryGroupEvent $event) { |
|
| 120 | + function(CategoryGroupEvent $event) { |
|
| 121 | 121 | Craft::debug( |
| 122 | 122 | 'Categories::EVENT_AFTER_DELETE_GROUP', |
| 123 | 123 | __METHOD__ |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | Event::on( |
| 133 | 133 | Categories::class, |
| 134 | 134 | Categories::EVENT_AFTER_SAVE_GROUP, |
| 135 | - function (CategoryGroupEvent $event) { |
|
| 135 | + function(CategoryGroupEvent $event) { |
|
| 136 | 136 | Craft::debug( |
| 137 | 137 | 'Categories::EVENT_AFTER_SAVE_GROUP', |
| 138 | 138 | __METHOD__ |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | Event::on( |
| 156 | 156 | Categories::class, |
| 157 | 157 | Categories::EVENT_AFTER_DELETE_GROUP, |
| 158 | - function (CategoryGroupEvent $event) { |
|
| 158 | + function(CategoryGroupEvent $event) { |
|
| 159 | 159 | Craft::debug( |
| 160 | 160 | 'Categories::EVENT_AFTER_DELETE_GROUP', |
| 161 | 161 | __METHOD__ |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | Event::on( |
| 185 | 185 | Category::class, |
| 186 | 186 | Category::EVENT_DEFINE_SIDEBAR_HTML, |
| 187 | - static function (DefineHtmlEvent $event) { |
|
| 187 | + static function(DefineHtmlEvent $event) { |
|
| 188 | 188 | Craft::debug( |
| 189 | 189 | 'Category::EVENT_DEFINE_SIDEBAR_HTML', |
| 190 | 190 | __METHOD__ |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | ->siteId($metaBundle->sourceSiteId) |
| 225 | 225 | ->limit($metaBundle->metaSitemapVars->sitemapLimit); |
| 226 | 226 | if (!empty($metaBundle->metaSitemapVars->structureDepth)) { |
| 227 | - $query->level('<=' . $metaBundle->metaSitemapVars->structureDepth); |
|
| 227 | + $query->level('<='.$metaBundle->metaSitemapVars->structureDepth); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | return $query; |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
| 382 | 382 | [ |
| 383 | 383 | 'sourceId' => $sourceModel->id, |
| 384 | - 'sourceName' => (string)$sourceModel->name, |
|
| 384 | + 'sourceName' => (string) $sourceModel->name, |
|
| 385 | 385 | 'sourceHandle' => $sourceModel->handle, |
| 386 | 386 | ] |
| 387 | 387 | ); |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | $lastSegment = end($segments); |
| 342 | 342 | $site = Craft::$app->getSites()->getSiteByHandle($lastSegment); |
| 343 | 343 | if ($site !== null) { |
| 344 | - $siteSuffix = '/' . $lastSegment; |
|
| 344 | + $siteSuffix = '/'.$lastSegment; |
|
| 345 | 345 | } |
| 346 | 346 | } |
| 347 | 347 | $currentUser = Craft::$app->getUser()->getIdentity(); |
@@ -349,31 +349,31 @@ discard block |
||
| 349 | 349 | if ($currentUser->can('seomatic:dashboard')) { |
| 350 | 350 | $subNavs['dashboard'] = [ |
| 351 | 351 | 'label' => Craft::t('seomatic', 'Dashboard'), |
| 352 | - 'url' => 'seomatic/dashboard' . $siteSuffix, |
|
| 352 | + 'url' => 'seomatic/dashboard'.$siteSuffix, |
|
| 353 | 353 | ]; |
| 354 | 354 | } |
| 355 | 355 | if ($currentUser->can('seomatic:global-meta')) { |
| 356 | 356 | $subNavs['global'] = [ |
| 357 | 357 | 'label' => Craft::t('seomatic', 'Global SEO'), |
| 358 | - 'url' => 'seomatic/global/general' . $siteSuffix, |
|
| 358 | + 'url' => 'seomatic/global/general'.$siteSuffix, |
|
| 359 | 359 | ]; |
| 360 | 360 | } |
| 361 | 361 | if ($currentUser->can('seomatic:content-meta')) { |
| 362 | 362 | $subNavs['content'] = [ |
| 363 | 363 | 'label' => Craft::t('seomatic', 'Content SEO'), |
| 364 | - 'url' => 'seomatic/content' . $siteSuffix, |
|
| 364 | + 'url' => 'seomatic/content'.$siteSuffix, |
|
| 365 | 365 | ]; |
| 366 | 366 | } |
| 367 | 367 | if ($currentUser->can('seomatic:site-settings')) { |
| 368 | 368 | $subNavs['site'] = [ |
| 369 | 369 | 'label' => Craft::t('seomatic', 'Site Settings'), |
| 370 | - 'url' => 'seomatic/site/identity' . $siteSuffix, |
|
| 370 | + 'url' => 'seomatic/site/identity'.$siteSuffix, |
|
| 371 | 371 | ]; |
| 372 | 372 | } |
| 373 | 373 | if ($currentUser->can('seomatic:tracking-scripts')) { |
| 374 | 374 | $subNavs['tracking'] = [ |
| 375 | 375 | 'label' => Craft::t('seomatic', 'Tracking Scripts'), |
| 376 | - 'url' => 'seomatic/tracking/gtag' . $siteSuffix, |
|
| 376 | + 'url' => 'seomatic/tracking/gtag'.$siteSuffix, |
|
| 377 | 377 | ]; |
| 378 | 378 | } |
| 379 | 379 | $editableSettings = true; |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | Event::on( |
| 419 | 419 | Plugins::class, |
| 420 | 420 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
| 421 | - function (PluginEvent $event) { |
|
| 421 | + function(PluginEvent $event) { |
|
| 422 | 422 | if ($event->plugin === $this) { |
| 423 | 423 | // Invalidate our caches after we've been installed |
| 424 | 424 | $this->clearAllCaches(); |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | Event::on( |
| 440 | 440 | ClearCaches::class, |
| 441 | 441 | ClearCaches::EVENT_REGISTER_CACHE_OPTIONS, |
| 442 | - function (RegisterCacheOptionsEvent $event) { |
|
| 442 | + function(RegisterCacheOptionsEvent $event) { |
|
| 443 | 443 | Craft::debug( |
| 444 | 444 | 'ClearCaches::EVENT_REGISTER_CACHE_OPTIONS', |
| 445 | 445 | __METHOD__ |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | Event::on( |
| 456 | 456 | Plugins::class, |
| 457 | 457 | Plugins::EVENT_BEFORE_SAVE_PLUGIN_SETTINGS, |
| 458 | - function (PluginEvent $event) { |
|
| 458 | + function(PluginEvent $event) { |
|
| 459 | 459 | if ($event->plugin === $this && !Craft::$app->getDb()->getSupportsMb4()) { |
| 460 | 460 | // For all the emojis |
| 461 | 461 | $settingsModel = $this->getSettings(); |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | Event::on( |
| 486 | 486 | Plugins::class, |
| 487 | 487 | Plugins::EVENT_AFTER_LOAD_PLUGINS, |
| 488 | - function () { |
|
| 488 | + function() { |
|
| 489 | 489 | // Delay registering SEO Elements to give other plugins a chance to load first |
| 490 | 490 | $this->seoElements->getAllSeoElementTypes(false); |
| 491 | 491 | // Delay installing GQL handlers to give other plugins a chance to register their own first |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | Event::on( |
| 507 | 507 | Fields::class, |
| 508 | 508 | Fields::EVENT_REGISTER_FIELD_TYPES, |
| 509 | - static function (RegisterComponentTypesEvent $event) { |
|
| 509 | + static function(RegisterComponentTypesEvent $event) { |
|
| 510 | 510 | $event->types[] = SeoSettingsField::class; |
| 511 | 511 | $event->types[] = Seomatic_MetaField::class; |
| 512 | 512 | } |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | Event::on( |
| 516 | 516 | Elements::class, |
| 517 | 517 | Elements::EVENT_AFTER_SAVE_ELEMENT, |
| 518 | - static function (ElementEvent $event) { |
|
| 518 | + static function(ElementEvent $event) { |
|
| 519 | 519 | Craft::debug( |
| 520 | 520 | 'Elements::EVENT_AFTER_SAVE_ELEMENT', |
| 521 | 521 | __METHOD__ |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | Event::on( |
| 536 | 536 | Elements::class, |
| 537 | 537 | Elements::EVENT_AFTER_DELETE_ELEMENT, |
| 538 | - static function (ElementEvent $event) { |
|
| 538 | + static function(ElementEvent $event) { |
|
| 539 | 539 | Craft::debug( |
| 540 | 540 | 'Elements::EVENT_AFTER_DELETE_ELEMENT', |
| 541 | 541 | __METHOD__ |
@@ -554,19 +554,19 @@ discard block |
||
| 554 | 554 | Event::on( |
| 555 | 555 | Entry::class, |
| 556 | 556 | Element::EVENT_REGISTER_PREVIEW_TARGETS, |
| 557 | - static function (RegisterPreviewTargetsEvent $e) { |
|
| 557 | + static function(RegisterPreviewTargetsEvent $e) { |
|
| 558 | 558 | /** @var Element $element */ |
| 559 | 559 | $element = $e->sender; |
| 560 | 560 | if ($element->uri !== null) { |
| 561 | 561 | $e->previewTargets[] = [ |
| 562 | - 'label' => ' |
|