@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | ->limit($metaBundle->metaSitemapVars->sitemapLimit); |
223 | 223 | if ($metaBundle->sourceType === 'structure' |
224 | 224 | && !empty($metaBundle->metaSitemapVars->structureDepth)) { |
225 | - $query->level($metaBundle->metaSitemapVars->structureDepth . '<='); |
|
225 | + $query->level($metaBundle->metaSitemapVars->structureDepth.'<='); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | return $query; |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | if (!empty($typeId)) { |
271 | 271 | $query |
272 | 272 | ->andWhere([ |
273 | - 'typeId' => (int)$typeId, |
|
273 | + 'typeId' => (int) $typeId, |
|
274 | 274 | ]); |
275 | 275 | } |
276 | 276 | $element = $query->one(); |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
398 | 398 | [ |
399 | 399 | 'sourceId' => $sourceModel->id, |
400 | - 'sourceName' => (string)$sourceModel->name, |
|
400 | + 'sourceName' => (string) $sourceModel->name, |
|
401 | 401 | 'sourceHandle' => $sourceModel->handle, |
402 | 402 | 'sourceType' => $sourceModel->type, |
403 | 403 | ] |
@@ -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]; |
@@ -755,7 +755,7 @@ discard block |
||
755 | 755 | ->from(['{{%seomatic_metabundles}}']) |
756 | 756 | ->where(['=', 'sourceBundleType', $seoElement::META_BUNDLE_TYPE]); |
757 | 757 | |
758 | - if ((int)$sourceSiteId !== 0) { |
|
758 | + if ((int) $sourceSiteId !== 0) { |
|
759 | 759 | $subQuery->andWhere(['sourceSiteId' => $sourceSiteId]); |
760 | 760 | } |
761 | 761 | if ($filter !== '') { |
@@ -792,7 +792,7 @@ discard block |
||
792 | 792 | public function getContentMetaBundleForElement(Element $element) |
793 | 793 | { |
794 | 794 | $source = $this->getMetaSourceFromElement($element); |
795 | - $key = implode(".", $source) . '.' . $element->siteId; |
|
795 | + $key = implode(".", $source).'.'.$element->siteId; |
|
796 | 796 | |
797 | 797 | if (empty($this->elementContentMetaBundles[$key])) { |
798 | 798 | $this->elementContentMetaBundles[$key] = $this->getMetaBundleBySourceId($source[1], $source[0], $element->siteId, $source[4]); |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | self::$cacheDuration = self::$devMode |
277 | 277 | ? self::DEVMODE_CACHE_DURATION |
278 | 278 | : self::$settings->metaCacheDuration ?? null; |
279 | - self::$cacheDuration = self::$cacheDuration === null ? null : (int)self::$cacheDuration; |
|
279 | + self::$cacheDuration = self::$cacheDuration === null ? null : (int) self::$cacheDuration; |
|
280 | 280 | self::$environment = EnvironmentHelper::determineEnvironment(); |
281 | 281 | MetaValueHelper::cache(); |
282 | 282 | // Version helpers |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | $lastSegment = end($segments); |
399 | 399 | $site = Craft::$app->getSites()->getSiteByHandle($lastSegment); |
400 | 400 | if ($site !== null) { |
401 | - $siteSuffix = '/' . $lastSegment; |
|
401 | + $siteSuffix = '/'.$lastSegment; |
|
402 | 402 | } |
403 | 403 | } |
404 | 404 | /** @var User $currentUser */ |
@@ -407,31 +407,31 @@ discard block |
||
407 | 407 | if ($currentUser->can('seomatic:dashboard')) { |
408 | 408 | $subNavs['dashboard'] = [ |
409 | 409 | 'label' => Craft::t('seomatic', 'Dashboard'), |
410 | - 'url' => 'seomatic/dashboard' . $siteSuffix, |
|
410 | + 'url' => 'seomatic/dashboard'.$siteSuffix, |
|
411 | 411 | ]; |
412 | 412 | } |
413 | 413 | if ($currentUser->can('seomatic:global-meta')) { |
414 | 414 | $subNavs['global'] = [ |
415 | 415 | 'label' => Craft::t('seomatic', 'Global SEO'), |
416 | - 'url' => 'seomatic/global/general' . $siteSuffix, |
|
416 | + 'url' => 'seomatic/global/general'.$siteSuffix, |
|
417 | 417 | ]; |
418 | 418 | } |
419 | 419 | if ($currentUser->can('seomatic:content-meta')) { |
420 | 420 | $subNavs['content'] = [ |
421 | 421 | 'label' => Craft::t('seomatic', 'Content SEO'), |
422 | - 'url' => 'seomatic/content' . $siteSuffix, |
|
422 | + 'url' => 'seomatic/content'.$siteSuffix, |
|
423 | 423 | ]; |
424 | 424 | } |
425 | 425 | if ($currentUser->can('seomatic:site-settings')) { |
426 | 426 | $subNavs['site'] = [ |
427 | 427 | 'label' => Craft::t('seomatic', 'Site Settings'), |
428 | - 'url' => 'seomatic/site/identity' . $siteSuffix, |
|
428 | + 'url' => 'seomatic/site/identity'.$siteSuffix, |
|
429 | 429 | ]; |
430 | 430 | } |
431 | 431 | if ($currentUser->can('seomatic:tracking-scripts')) { |
432 | 432 | $subNavs['tracking'] = [ |
433 | 433 | 'label' => Craft::t('seomatic', 'Tracking Scripts'), |
434 | - 'url' => 'seomatic/tracking/gtag' . $siteSuffix, |
|
434 | + 'url' => 'seomatic/tracking/gtag'.$siteSuffix, |
|
435 | 435 | ]; |
436 | 436 | } |
437 | 437 | $editableSettings = true; |
@@ -626,14 +626,14 @@ discard block |
||
626 | 626 | $element = $e->sender; |
627 | 627 | if ($element->uri !== null) { |
628 | 628 | $e->previewTargets[] = [ |
629 | - 'label' => ' |