@@ -509,8 +509,8 @@ discard block |
||
509 | 509 | string $sourceBundleType, |
510 | 510 | string $sourceHandle, |
511 | 511 | string $siteHandle = null, |
512 | - $typeId = null, |
|
513 | - $loadFromSiteHandle = null |
|
512 | + $typeId = null, |
|
513 | + $loadFromSiteHandle = null |
|
514 | 514 | ): Response { |
515 | 515 | $variables = []; |
516 | 516 | // @TODO: Let people choose an entry/categorygroup/product as the preview |
@@ -1226,7 +1226,7 @@ discard block |
||
1226 | 1226 | string $sourceHandle, |
1227 | 1227 | string $groupName, |
1228 | 1228 | array &$variables, |
1229 | - $typeId = null |
|
1229 | + $typeId = null |
|
1230 | 1230 | ) { |
1231 | 1231 | $variables['textFieldSources'] = array_merge( |
1232 | 1232 | ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'], |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $variables['pluginName'] = Seomatic::$settings->pluginName; |
132 | 132 | $variables['title'] = $templateTitle; |
133 | 133 | $variables['docTitle'] = "{$pluginName} - {$templateTitle}"; |
134 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
134 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
135 | 135 | $variables['crumbs'] = [ |
136 | 136 | [ |
137 | 137 | 'label' => $pluginName, |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | ], |
140 | 140 | [ |
141 | 141 | 'label' => $templateTitle, |
142 | - 'url' => UrlHelper::cpUrl('seomatic/dashboard' . $siteHandleUri), |
|
142 | + 'url' => UrlHelper::cpUrl('seomatic/dashboard'.$siteHandleUri), |
|
143 | 143 | ], |
144 | 144 | ]; |
145 | 145 | $variables['selectedSubnavItem'] = 'dashboard'; |
@@ -162,11 +162,11 @@ discard block |
||
162 | 162 | foreach ($variables['metaBundles'] as $metaBundle) { |
163 | 163 | $stat = 0; |
164 | 164 | foreach (self::SEO_SETUP_FIELDS as $setupField => $setupLabel) { |
165 | - $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]); |
|
165 | + $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]); |
|
166 | 166 | $value = $variables['contentSetupChecklist'][$setupField]['value'] ?? 0; |
167 | 167 | $variables['contentSetupChecklist'][$setupField] = [ |
168 | 168 | 'label' => $setupLabel, |
169 | - 'value' => $value + (int)!empty($metaBundle->metaGlobalVars[$setupField]), |
|
169 | + 'value' => $value + (int) !empty($metaBundle->metaGlobalVars[$setupField]), |
|
170 | 170 | ]; |
171 | 171 | } |
172 | 172 | $stat = round($numGrades - (($stat * $numGrades) / $numFields)); |
@@ -177,16 +177,16 @@ discard block |
||
177 | 177 | } |
178 | 178 | // Global SEO grades |
179 | 179 | Seomatic::$previewingMetaContainers = true; |
180 | - $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int)$siteId); |
|
180 | + $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int) $siteId); |
|
181 | 181 | Seomatic::$previewingMetaContainers = false; |
182 | 182 | if ($metaBundle !== null) { |
183 | 183 | $stat = 0; |
184 | 184 | $variables['globalSetupChecklist'] = []; |
185 | 185 | foreach (self::SEO_SETUP_FIELDS as $setupField => $setupLabel) { |
186 | - $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]); |
|
186 | + $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]); |
|
187 | 187 | $variables['globalSetupChecklist'][$setupField] = [ |
188 | 188 | 'label' => $setupLabel, |
189 | - 'value' => (int)!empty($metaBundle->metaGlobalVars[$setupField]), |
|
189 | + 'value' => (int) !empty($metaBundle->metaGlobalVars[$setupField]), |
|
190 | 190 | ]; |
191 | 191 | } |
192 | 192 | $stat = round(($stat / $numFields) * 100); |
@@ -196,17 +196,17 @@ discard block |
||
196 | 196 | $stat = 0; |
197 | 197 | $variables['siteSetupChecklist'] = []; |
198 | 198 | foreach (self::SITE_SETUP_FIELDS as $setupField => $setupLabel) { |
199 | - $stat += (int)!empty($metaBundle->metaSiteVars[$setupField]); |
|
199 | + $stat += (int) !empty($metaBundle->metaSiteVars[$setupField]); |
|
200 | 200 | $variables['siteSetupChecklist'][$setupField] = [ |
201 | 201 | 'label' => $setupLabel, |
202 | - 'value' => (int)!empty($metaBundle->metaSiteVars[$setupField]), |
|
202 | + 'value' => (int) !empty($metaBundle->metaSiteVars[$setupField]), |
|
203 | 203 | ]; |
204 | 204 | } |
205 | 205 | foreach (self::IDENTITY_SETUP_FIELDS as $setupField => $setupLabel) { |
206 | - $stat += (int)!empty($metaBundle->metaSiteVars->identity[$setupField]); |
|
206 | + $stat += (int) !empty($metaBundle->metaSiteVars->identity[$setupField]); |
|
207 | 207 | $variables['siteSetupChecklist'][$setupField] = [ |
208 | 208 | 'label' => $setupLabel, |
209 | - 'value' => (int)!empty($metaBundle->metaSiteVars->identity[$setupField]), |
|
209 | + 'value' => (int) !empty($metaBundle->metaSiteVars->identity[$setupField]), |
|
210 | 210 | ]; |
211 | 211 | } |
212 | 212 | $stat = round(($stat / $numFields) * 100); |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | $variables['title'] = $templateTitle; |
254 | 254 | $variables['subSectionTitle'] = $subSectionTitle; |
255 | 255 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
256 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
256 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
257 | 257 | $variables['crumbs'] = [ |
258 | 258 | [ |
259 | 259 | 'label' => $pluginName, |
@@ -261,11 +261,11 @@ discard block |
||
261 | 261 | ], |
262 | 262 | [ |
263 | 263 | 'label' => $templateTitle, |
264 | - 'url' => UrlHelper::cpUrl('seomatic/global/general' . $siteHandleUri), |
|
264 | + 'url' => UrlHelper::cpUrl('seomatic/global/general'.$siteHandleUri), |
|
265 | 265 | ], |
266 | 266 | [ |
267 | 267 | 'label' => $subSectionTitle, |
268 | - 'url' => UrlHelper::cpUrl('seomatic/global/' . $subSection . $siteHandleUri), |
|
268 | + 'url' => UrlHelper::cpUrl('seomatic/global/'.$subSection.$siteHandleUri), |
|
269 | 269 | ], |
270 | 270 | ]; |
271 | 271 | $variables['selectedSubnavItem'] = 'global'; |
@@ -273,14 +273,14 @@ discard block |
||
273 | 273 | $this->setGlobalFieldSourceVariables($variables); |
274 | 274 | // Enabled sites |
275 | 275 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
276 | - $variables['controllerHandle'] = 'global' . '/' . $subSection; |
|
276 | + $variables['controllerHandle'] = 'global'.'/'.$subSection; |
|
277 | 277 | $variables['currentSubSection'] = $subSection; |
278 | 278 | // Meta bundle settings |
279 | 279 | Seomatic::$previewingMetaContainers = true; |
280 | 280 | // Get the site to copy the settings from, if any |
281 | 281 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
282 | 282 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
283 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
283 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
284 | 284 | // Load the metabundle |
285 | 285 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
286 | 286 | if ($editedMetaBundle) { |
@@ -334,11 +334,11 @@ discard block |
||
334 | 334 | // Preview the meta containers |
335 | 335 | Seomatic::$plugin->metaContainers->previewMetaContainers( |
336 | 336 | MetaBundles::GLOBAL_META_BUNDLE, |
337 | - (int)$variables['currentSiteId'] |
|
337 | + (int) $variables['currentSiteId'] |
|
338 | 338 | ); |
339 | 339 | |
340 | 340 | // Render the template |
341 | - return $this->renderTemplate('seomatic/settings/global/' . $subSection, $variables); |
|
341 | + return $this->renderTemplate('seomatic/settings/global/'.$subSection, $variables); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | /** |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | $variables['pluginName'] = Seomatic::$settings->pluginName; |
470 | 470 | $variables['title'] = $templateTitle; |
471 | 471 | $variables['docTitle'] = "{$pluginName} - {$templateTitle}"; |
472 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
472 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
473 | 473 | $variables['crumbs'] = [ |
474 | 474 | [ |
475 | 475 | 'label' => $pluginName, |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | ], |
478 | 478 | [ |
479 | 479 | 'label' => $templateTitle, |
480 | - 'url' => UrlHelper::cpUrl('seomatic/content' . $siteHandleUri), |
|
480 | + 'url' => UrlHelper::cpUrl('seomatic/content'.$siteHandleUri), |
|
481 | 481 | ], |
482 | 482 | ]; |
483 | 483 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | // Get the site to edit |
518 | 518 | $siteId = $this->getSiteIdFromHandle($siteHandle); |
519 | 519 | if (is_string($typeId)) { |
520 | - $typeId = (int)$typeId; |
|
520 | + $typeId = (int) $typeId; |
|
521 | 521 | } |
522 | 522 | // Get the (entry) type menu |
523 | 523 | $typeMenu = []; |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | $currentType = reset($typeMenu); |
532 | 532 | $variables['currentType'] = $typeMenu[$typeId] ?? $currentType; |
533 | 533 | $variables['currentTypeId'] = $typeId ?? key($typeMenu); |
534 | - $typeId = (int)$variables['currentTypeId']; |
|
534 | + $typeId = (int) $variables['currentTypeId']; |
|
535 | 535 | } |
536 | 536 | $pluginName = Seomatic::$settings->pluginName; |
537 | 537 | // Asset bundle |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | // Get the site to copy the settings from, if any |
553 | 553 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
554 | 554 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
555 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
555 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
556 | 556 | // Load the metabundle |
557 | 557 | $metaBundle = Seomatic::$plugin->metaBundles->getMetaBundleBySourceHandle( |
558 | 558 | $sourceBundleType, |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | $variables['title'] = $templateTitle; |
579 | 579 | $variables['subSectionTitle'] = $subSectionTitle; |
580 | 580 | $variables['docTitle'] = "{$pluginName} - Content SEO - {$templateTitle} - {$subSectionTitle}"; |
581 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
581 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
582 | 582 | $variables['siteHandleUri'] = $siteHandleUri; |
583 | 583 | $variables['crumbs'] = [ |
584 | 584 | [ |
@@ -587,10 +587,10 @@ discard block |
||
587 | 587 | ], |
588 | 588 | [ |
589 | 589 | 'label' => 'Content SEO', |
590 | - 'url' => UrlHelper::cpUrl('seomatic/content' . $siteHandleUri), |
|
590 | + 'url' => UrlHelper::cpUrl('seomatic/content'.$siteHandleUri), |
|
591 | 591 | ], |
592 | 592 | [ |
593 | - 'label' => $metaBundle->sourceName . ' · ' . $subSectionTitle, |
|
593 | + 'label' => $metaBundle->sourceName.' · '.$subSectionTitle, |
|
594 | 594 | 'url' => UrlHelper::cpUrl("seomatic/edit-content/${subSection}/${sourceBundleType}/${sourceHandle}"), |
595 | 595 | ], |
596 | 596 | ]; |
@@ -620,13 +620,13 @@ discard block |
||
620 | 620 | // Preview the meta containers |
621 | 621 | Seomatic::$plugin->metaContainers->previewMetaContainers( |
622 | 622 | $uri, |
623 | - (int)$variables['currentSiteId'], |
|
623 | + (int) $variables['currentSiteId'], |
|
624 | 624 | false, |
625 | 625 | false |
626 | 626 | ); |
627 | 627 | |
628 | 628 | // Render the template |
629 | - return $this->renderTemplate('seomatic/settings/content/' . $subSection, $variables); |
|
629 | + return $this->renderTemplate('seomatic/settings/content/'.$subSection, $variables); |
|
630 | 630 | } |
631 | 631 | |
632 | 632 | /** |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | $bundleSettings = $request->getParam('metaBundleSettings'); |
647 | 647 | $sitemapSettings = $request->getParam('metaSitemapVars'); |
648 | 648 | if (is_string($typeId)) { |
649 | - $typeId = (int)$typeId; |
|
649 | + $typeId = (int) $typeId; |
|
650 | 650 | } |
651 | 651 | // Set the element type in the template |
652 | 652 | $elementName = ''; |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | if ($subSection === 'social') { |
712 | 712 | $subSectionSuffix = ' Media'; |
713 | 713 | } |
714 | - $subSectionTitle = Craft::t('seomatic', ucfirst($subSection) . $subSectionSuffix); |
|
714 | + $subSectionTitle = Craft::t('seomatic', ucfirst($subSection).$subSectionSuffix); |
|
715 | 715 | // Asset bundle |
716 | 716 | try { |
717 | 717 | Seomatic::$view->registerAssetBundle(SeomaticAsset::class); |
@@ -729,7 +729,7 @@ discard block |
||
729 | 729 | $variables['title'] = $templateTitle; |
730 | 730 | $variables['subSectionTitle'] = $subSectionTitle; |
731 | 731 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
732 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
732 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
733 | 733 | $variables['crumbs'] = [ |
734 | 734 | [ |
735 | 735 | 'label' => $pluginName, |
@@ -737,11 +737,11 @@ discard block |
||
737 | 737 | ], |
738 | 738 | [ |
739 | 739 | 'label' => $templateTitle, |
740 | - 'url' => UrlHelper::cpUrl('seomatic/site/identity' . $siteHandleUri), |
|
740 | + 'url' => UrlHelper::cpUrl('seomatic/site/identity'.$siteHandleUri), |
|
741 | 741 | ], |
742 | 742 | [ |
743 | 743 | 'label' => $subSectionTitle, |
744 | - 'url' => UrlHelper::cpUrl('seomatic/site/' . $subSection . $siteHandleUri), |
|
744 | + 'url' => UrlHelper::cpUrl('seomatic/site/'.$subSection.$siteHandleUri), |
|
745 | 745 | ], |
746 | 746 | ]; |
747 | 747 | $variables['selectedSubnavItem'] = 'site'; |
@@ -749,14 +749,14 @@ discard block |
||
749 | 749 | |
750 | 750 | // Enabled sites |
751 | 751 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
752 | - $variables['controllerHandle'] = 'site' . '/' . $subSection; |
|
752 | + $variables['controllerHandle'] = 'site'.'/'.$subSection; |
|
753 | 753 | |
754 | 754 | // The site settings for the appropriate meta bundle |
755 | 755 | Seomatic::$previewingMetaContainers = true; |
756 | 756 | // Get the site to copy the settings from, if any |
757 | 757 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
758 | 758 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
759 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
759 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
760 | 760 | // Load the metabundle |
761 | 761 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
762 | 762 | Seomatic::$previewingMetaContainers = false; |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | $variables['elementType'] = Asset::class; |
775 | 775 | |
776 | 776 | // Render the template |
777 | - return $this->renderTemplate('seomatic/settings/site/' . $subSection, $variables); |
|
777 | + return $this->renderTemplate('seomatic/settings/site/'.$subSection, $variables); |
|
778 | 778 | } |
779 | 779 | |
780 | 780 | /** |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | $siteId = $this->getSiteIdFromHandle($siteHandle); |
908 | 908 | // Enabled sites |
909 | 909 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
910 | - $variables['controllerHandle'] = 'tracking' . '/' . $subSection; |
|
910 | + $variables['controllerHandle'] = 'tracking'.'/'.$subSection; |
|
911 | 911 | $variables['currentSubSection'] = $subSection; |
912 | 912 | |
913 | 913 | // The script meta containers for the global meta bundle |
@@ -915,7 +915,7 @@ discard block |
||
915 | 915 | // Get the site to copy the settings from, if any |
916 | 916 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
917 | 917 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
918 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
918 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
919 | 919 | // Load the metabundle |
920 | 920 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
921 | 921 | if ($editedMetaBundle) { |
@@ -955,7 +955,7 @@ discard block |
||
955 | 955 | $variables['title'] = $templateTitle; |
956 | 956 | $variables['subSectionTitle'] = $subSectionTitle; |
957 | 957 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
958 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
958 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
959 | 959 | $variables['crumbs'] = [ |
960 | 960 | [ |
961 | 961 | 'label' => $pluginName, |
@@ -967,7 +967,7 @@ discard block |
||
967 | 967 | ], |
968 | 968 | [ |
969 | 969 | 'label' => $subSectionTitle, |
970 | - 'url' => UrlHelper::cpUrl('seomatic/tracking/' . $subSection . $siteHandleUri), |
|
970 | + 'url' => UrlHelper::cpUrl('seomatic/tracking/'.$subSection.$siteHandleUri), |
|
971 | 971 | ], |
972 | 972 | ]; |
973 | 973 | $variables['selectedSubnavItem'] = 'tracking'; |
@@ -1106,7 +1106,7 @@ discard block |
||
1106 | 1106 | if ($siteHandle !== null) { |
1107 | 1107 | $site = Craft::$app->getSites()->getSiteByHandle($siteHandle); |
1108 | 1108 | if (!$site) { |
1109 | - throw new NotFoundHttpException('Invalid site handle: ' . $siteHandle); |
|
1109 | + throw new NotFoundHttpException('Invalid site handle: '.$siteHandle); |
|
1110 | 1110 | } |
1111 | 1111 | $siteId = $site->id; |
1112 | 1112 | } else { |
@@ -1142,7 +1142,7 @@ discard block |
||
1142 | 1142 | if (!empty($variables['enabledSiteIds'])) { |
1143 | 1143 | $siteId = reset($variables['enabledSiteIds']); |
1144 | 1144 | } else { |
1145 | - $this->requirePermission('editSite:' . $siteId); |
|
1145 | + $this->requirePermission('editSite:'.$siteId); |
|
1146 | 1146 | } |
1147 | 1147 | } |
1148 | 1148 | } |
@@ -1162,7 +1162,7 @@ discard block |
||
1162 | 1162 | if ($variables['showSites']) { |
1163 | 1163 | $variables['sitesMenuLabel'] = Craft::t( |
1164 | 1164 | 'site', |
1165 | - $sites->getSiteById((int)$variables['currentSiteId'])->name |
|
1165 | + $sites->getSiteById((int) $variables['currentSiteId'])->name |
|
1166 | 1166 | ); |
1167 | 1167 | } else { |
1168 | 1168 | $variables['sitesMenuLabel'] = ''; |
@@ -1229,7 +1229,7 @@ discard block |
||
1229 | 1229 | $typeId = null |
1230 | 1230 | ) { |
1231 | 1231 | $variables['textFieldSources'] = array_merge( |
1232 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'], |
|
1232 | + ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'], |
|
1233 | 1233 | FieldHelper::fieldsOfTypeFromSource( |
1234 | 1234 | $sourceBundleType, |
1235 | 1235 | $sourceHandle, |
@@ -1239,7 +1239,7 @@ discard block |
||
1239 | 1239 | ) |
1240 | 1240 | ); |
1241 | 1241 | $variables['assetFieldSources'] = array_merge( |
1242 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields']], |
|
1242 | + ['entryGroup' => ['optgroup' => $groupName.' Fields']], |
|
1243 | 1243 | FieldHelper::fieldsOfTypeFromSource( |
1244 | 1244 | $sourceBundleType, |
1245 | 1245 | $sourceHandle, |
@@ -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]); |
@@ -275,7 +275,7 @@ |
||
275 | 275 | string $sourceHandle, |
276 | 276 | string $fieldClassKey, |
277 | 277 | bool $keysOnly = true, |
278 | - $typeId = null |
|
278 | + $typeId = null |
|
279 | 279 | ): array { |
280 | 280 | $foundFields = []; |
281 | 281 | $layouts = []; |