@@ -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'], |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | /** |
90 | 90 | * @inheritdoc |
91 | 91 | */ |
92 | - protected array|bool|int $allowAnonymous = [ |
|
92 | + protected array | bool | int $allowAnonymous = [ |
|
93 | 93 | ]; |
94 | 94 | |
95 | 95 | // 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,13 +336,13 @@ 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 | $this->setCrumbVariables($variables); |
343 | 343 | |
344 | 344 | // Render the template |
345 | - return $this->renderTemplate('seomatic/settings/global/' . $subSection, $variables); |
|
345 | + return $this->renderTemplate('seomatic/settings/global/'.$subSection, $variables); |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | /** |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | $variables['pluginName'] = Seomatic::$settings->pluginName; |
474 | 474 | $variables['title'] = $templateTitle; |
475 | 475 | $variables['docTitle'] = "{$pluginName} - {$templateTitle}"; |
476 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
476 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
477 | 477 | $variables['crumbs'] = [ |
478 | 478 | [ |
479 | 479 | 'label' => $pluginName, |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | ], |
482 | 482 | [ |
483 | 483 | 'label' => $templateTitle, |
484 | - 'url' => UrlHelper::cpUrl('seomatic/content' . $siteHandleUri), |
|
484 | + 'url' => UrlHelper::cpUrl('seomatic/content'.$siteHandleUri), |
|
485 | 485 | ], |
486 | 486 | ]; |
487 | 487 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | // Get the site to edit |
523 | 523 | $siteId = $this->getSiteIdFromHandle($siteHandle); |
524 | 524 | if (is_string($typeId)) { |
525 | - $typeId = (int)$typeId; |
|
525 | + $typeId = (int) $typeId; |
|
526 | 526 | } |
527 | 527 | // Get the (entry) type menu |
528 | 528 | $typeMenu = []; |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | $currentType = reset($typeMenu); |
537 | 537 | $variables['currentType'] = $typeMenu[$typeId] ?? $currentType; |
538 | 538 | $variables['currentTypeId'] = $typeId ?? key($typeMenu); |
539 | - $typeId = (int)$variables['currentTypeId']; |
|
539 | + $typeId = (int) $variables['currentTypeId']; |
|
540 | 540 | } |
541 | 541 | $pluginName = Seomatic::$settings->pluginName; |
542 | 542 | // Asset bundle |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | // Get the site to copy the settings from, if any |
558 | 558 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
559 | 559 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
560 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
560 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
561 | 561 | // Load the metabundle |
562 | 562 | $metaBundle = Seomatic::$plugin->metaBundles->getMetaBundleBySourceHandle( |
563 | 563 | $sourceBundleType, |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | $variables['title'] = $templateTitle; |
584 | 584 | $variables['subSectionTitle'] = $subSectionTitle; |
585 | 585 | $variables['docTitle'] = "{$pluginName} - Content SEO - {$templateTitle} - {$subSectionTitle}"; |
586 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
586 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
587 | 587 | $variables['siteHandleUri'] = $siteHandleUri; |
588 | 588 | $variables['crumbs'] = [ |
589 | 589 | [ |
@@ -592,10 +592,10 @@ discard block |
||
592 | 592 | ], |
593 | 593 | [ |
594 | 594 | 'label' => 'Content SEO', |
595 | - 'url' => UrlHelper::cpUrl('seomatic/content' . $siteHandleUri), |
|
595 | + 'url' => UrlHelper::cpUrl('seomatic/content'.$siteHandleUri), |
|
596 | 596 | ], |
597 | 597 | [ |
598 | - 'label' => $metaBundle->sourceName . ' · ' . $subSectionTitle, |
|
598 | + 'label' => $metaBundle->sourceName.' · '.$subSectionTitle, |
|
599 | 599 | 'url' => UrlHelper::cpUrl("seomatic/edit-content/{$subSection}/{$sourceBundleType}/{$sourceHandle}"), |
600 | 600 | ], |
601 | 601 | ]; |
@@ -626,13 +626,13 @@ discard block |
||
626 | 626 | // Preview the meta containers |
627 | 627 | Seomatic::$plugin->metaContainers->previewMetaContainers( |
628 | 628 | $uri, |
629 | - (int)$variables['currentSiteId'], |
|
629 | + (int) $variables['currentSiteId'], |
|
630 | 630 | false, |
631 | 631 | false |
632 | 632 | ); |
633 | 633 | |
634 | 634 | // Render the template |
635 | - return $this->renderTemplate('seomatic/settings/content/' . $subSection, $variables); |
|
635 | + return $this->renderTemplate('seomatic/settings/content/'.$subSection, $variables); |
|
636 | 636 | } |
637 | 637 | |
638 | 638 | /** |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | $bundleSettings = $request->getParam('metaBundleSettings'); |
653 | 653 | $sitemapSettings = $request->getParam('metaSitemapVars'); |
654 | 654 | if (is_string($typeId)) { |
655 | - $typeId = (int)$typeId; |
|
655 | + $typeId = (int) $typeId; |
|
656 | 656 | } |
657 | 657 | // Set the element type in the template |
658 | 658 | $elementName = ''; |
@@ -717,7 +717,7 @@ discard block |
||
717 | 717 | if ($subSection === 'social') { |
718 | 718 | $subSectionSuffix = ' Media'; |
719 | 719 | } |
720 | - $subSectionTitle = Craft::t('seomatic', ucfirst($subSection) . $subSectionSuffix); |
|
720 | + $subSectionTitle = Craft::t('seomatic', ucfirst($subSection).$subSectionSuffix); |
|
721 | 721 | // Asset bundle |
722 | 722 | try { |
723 | 723 | Seomatic::$view->registerAssetBundle(SeomaticAsset::class); |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | $variables['title'] = $templateTitle; |
736 | 736 | $variables['subSectionTitle'] = $subSectionTitle; |
737 | 737 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
738 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
738 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
739 | 739 | $variables['crumbs'] = [ |
740 | 740 | [ |
741 | 741 | 'label' => $pluginName, |
@@ -743,11 +743,11 @@ discard block |
||
743 | 743 | ], |
744 | 744 | [ |
745 | 745 | 'label' => $templateTitle, |
746 | - 'url' => UrlHelper::cpUrl('seomatic/site/identity' . $siteHandleUri), |
|
746 | + 'url' => UrlHelper::cpUrl('seomatic/site/identity'.$siteHandleUri), |
|
747 | 747 | ], |
748 | 748 | [ |
749 | 749 | 'label' => $subSectionTitle, |
750 | - 'url' => UrlHelper::cpUrl('seomatic/site/' . $subSection . $siteHandleUri), |
|
750 | + 'url' => UrlHelper::cpUrl('seomatic/site/'.$subSection.$siteHandleUri), |
|
751 | 751 | ], |
752 | 752 | ]; |
753 | 753 | $variables['selectedSubnavItem'] = 'site'; |
@@ -755,14 +755,14 @@ discard block |
||
755 | 755 | |
756 | 756 | // Enabled sites |
757 | 757 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
758 | - $variables['controllerHandle'] = 'site' . '/' . $subSection; |
|
758 | + $variables['controllerHandle'] = 'site'.'/'.$subSection; |
|
759 | 759 | |
760 | 760 | // The site settings for the appropriate meta bundle |
761 | 761 | Seomatic::$previewingMetaContainers = true; |
762 | 762 | // Get the site to copy the settings from, if any |
763 | 763 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
764 | 764 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
765 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
765 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
766 | 766 | // Load the metabundle |
767 | 767 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
768 | 768 | Seomatic::$previewingMetaContainers = false; |
@@ -781,7 +781,7 @@ discard block |
||
781 | 781 | $this->setCrumbVariables($variables); |
782 | 782 | |
783 | 783 | // Render the template |
784 | - return $this->renderTemplate('seomatic/settings/site/' . $subSection, $variables); |
|
784 | + return $this->renderTemplate('seomatic/settings/site/'.$subSection, $variables); |
|
785 | 785 | } |
786 | 786 | |
787 | 787 | /** |
@@ -912,7 +912,7 @@ discard block |
||
912 | 912 | $siteId = $this->getSiteIdFromHandle($siteHandle); |
913 | 913 | // Enabled sites |
914 | 914 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
915 | - $variables['controllerHandle'] = 'tracking' . '/' . $subSection; |
|
915 | + $variables['controllerHandle'] = 'tracking'.'/'.$subSection; |
|
916 | 916 | $variables['currentSubSection'] = $subSection; |
917 | 917 | |
918 | 918 | // The script meta containers for the global meta bundle |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | // Get the site to copy the settings from, if any |
921 | 921 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
922 | 922 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
923 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
923 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
924 | 924 | // Load the metabundle |
925 | 925 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
926 | 926 | if ($editedMetaBundle) { |
@@ -960,7 +960,7 @@ discard block |
||
960 | 960 | $variables['title'] = $templateTitle; |
961 | 961 | $variables['subSectionTitle'] = $subSectionTitle; |
962 | 962 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
963 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
963 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
964 | 964 | $variables['crumbs'] = [ |
965 | 965 | [ |
966 | 966 | 'label' => $pluginName, |
@@ -972,7 +972,7 @@ discard block |
||
972 | 972 | ], |
973 | 973 | [ |
974 | 974 | 'label' => $subSectionTitle, |
975 | - 'url' => UrlHelper::cpUrl('seomatic/tracking/' . $subSection . $siteHandleUri), |
|
975 | + 'url' => UrlHelper::cpUrl('seomatic/tracking/'.$subSection.$siteHandleUri), |
|
976 | 976 | ], |
977 | 977 | ]; |
978 | 978 | $variables['selectedSubnavItem'] = 'tracking'; |
@@ -1110,7 +1110,7 @@ discard block |
||
1110 | 1110 | if ($siteHandle !== null) { |
1111 | 1111 | $site = Craft::$app->getSites()->getSiteByHandle($siteHandle); |
1112 | 1112 | if (!$site) { |
1113 | - throw new NotFoundHttpException('Invalid site handle: ' . $siteHandle); |
|
1113 | + throw new NotFoundHttpException('Invalid site handle: '.$siteHandle); |
|
1114 | 1114 | } |
1115 | 1115 | $siteId = $site->id; |
1116 | 1116 | } else { |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | if (!empty($variables['enabledSiteIds'])) { |
1148 | 1148 | $siteId = reset($variables['enabledSiteIds']); |
1149 | 1149 | } else { |
1150 | - $this->requirePermission('editSite:' . $siteId); |
|
1150 | + $this->requirePermission('editSite:'.$siteId); |
|
1151 | 1151 | } |
1152 | 1152 | } |
1153 | 1153 | } |
@@ -1219,7 +1219,7 @@ discard block |
||
1219 | 1219 | 'icon' => 'world', |
1220 | 1220 | 'label' => Craft::t( |
1221 | 1221 | 'site', |
1222 | - $sites->getSiteById((int)$variables['currentSiteId'])->name |
|
1222 | + $sites->getSiteById((int) $variables['currentSiteId'])->name |
|
1223 | 1223 | ), |
1224 | 1224 | 'menu' => [ |
1225 | 1225 | 'items' => $siteCrumbItems, |
@@ -1235,7 +1235,7 @@ discard block |
||
1235 | 1235 | 'icon' => 'world', |
1236 | 1236 | 'label' => Craft::t( |
1237 | 1237 | 'site', |
1238 | - $sites->getSiteById((int)$variables['currentSiteId'])->name |
|
1238 | + $sites->getSiteById((int) $variables['currentSiteId'])->name |
|
1239 | 1239 | ), |
1240 | 1240 | 'menu' => [ |
1241 | 1241 | 'items' => $siteCrumbItems, |
@@ -1246,7 +1246,7 @@ discard block |
||
1246 | 1246 | } |
1247 | 1247 | $variables['sitesMenuLabel'] = Craft::t( |
1248 | 1248 | 'site', |
1249 | - $sites->getSiteById((int)$variables['currentSiteId'])->name |
|
1249 | + $sites->getSiteById((int) $variables['currentSiteId'])->name |
|
1250 | 1250 | ); |
1251 | 1251 | } else { |
1252 | 1252 | $variables['sitesMenuLabel'] = ''; |
@@ -1326,7 +1326,7 @@ discard block |
||
1326 | 1326 | $typeId = null, |
1327 | 1327 | ) { |
1328 | 1328 | $variables['textFieldSources'] = array_merge( |
1329 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'], |
|
1329 | + ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'], |
|
1330 | 1330 | FieldHelper::fieldsOfTypeFromSource( |
1331 | 1331 | $sourceBundleType, |
1332 | 1332 | $sourceHandle, |
@@ -1336,7 +1336,7 @@ discard block |
||
1336 | 1336 | ) |
1337 | 1337 | ); |
1338 | 1338 | $variables['assetFieldSources'] = array_merge( |
1339 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields']], |
|
1339 | + ['entryGroup' => ['optgroup' => $groupName.' Fields']], |
|
1340 | 1340 | FieldHelper::fieldsOfTypeFromSource( |
1341 | 1341 | $sourceBundleType, |
1342 | 1342 | $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 |