@@ -66,8 +66,8 @@ |
||
| 66 | 66 | string $sort = 'sourceName|asc', |
| 67 | 67 | int $page = 1, |
| 68 | 68 | int $per_page = 20, |
| 69 | - $filter = '', |
|
| 70 | - $siteId = 0 |
|
| 69 | + $filter = '', |
|
| 70 | + $siteId = 0 |
|
| 71 | 71 | ): Response { |
| 72 | 72 | $data = []; |
| 73 | 73 | $sortField = 'sourceName'; |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | // Query the db table |
| 100 | 100 | $offset = ($page - 1) * $per_page; |
| 101 | 101 | $currentSiteHandle = ''; |
| 102 | - if ((int)$siteId !== 0) { |
|
| 102 | + if ((int) $siteId !== 0) { |
|
| 103 | 103 | $site = Craft::$app->getSites()->getSiteById($siteId); |
| 104 | 104 | if ($site !== null) { |
| 105 | 105 | $currentSiteHandle = $site->handle; |
@@ -156,11 +156,11 @@ discard block |
||
| 156 | 156 | $numGrades = count(SettingsController::SETUP_GRADES); |
| 157 | 157 | $numFields = count(SettingsController::SEO_SETUP_FIELDS); |
| 158 | 158 | foreach (SettingsController::SEO_SETUP_FIELDS as $setupField => $setupLabel) { |
| 159 | - $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]); |
|
| 159 | + $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]); |
|
| 160 | 160 | $value = $variables['contentSetupChecklist'][$setupField]['value'] ?? 0; |
| 161 | 161 | $variables['contentSetupChecklist'][$setupField] = [ |
| 162 | 162 | 'label' => $setupLabel, |
| 163 | - 'value' => $value + (int)!empty($metaBundle->metaGlobalVars[$setupField]), |
|
| 163 | + 'value' => $value + (int) !empty($metaBundle->metaGlobalVars[$setupField]), |
|
| 164 | 164 | ]; |
| 165 | 165 | } |
| 166 | 166 | $stat = round($numGrades - (($stat * $numGrades) / $numFields)); |
@@ -601,8 +601,8 @@ |
||
| 601 | 601 | string $sourceBundleType, |
| 602 | 602 | string $sourceHandle, |
| 603 | 603 | string $siteHandle = null, |
| 604 | - $typeId = null, |
|
| 605 | - $loadFromSiteHandle = null |
|
| 604 | + $typeId = null, |
|
| 605 | + $loadFromSiteHandle = null |
|
| 606 | 606 | ): Response { |
| 607 | 607 | $variables = []; |
| 608 | 608 | // @TODO: Let people choose an entry/categorygroup/product as the preview |
@@ -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 | /** |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | $variables['pluginName'] = Seomatic::$settings->pluginName; |
| 466 | 466 | $variables['title'] = $templateTitle; |
| 467 | 467 | $variables['docTitle'] = "{$pluginName} - {$templateTitle}"; |
| 468 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 468 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 469 | 469 | $variables['crumbs'] = [ |
| 470 | 470 | [ |
| 471 | 471 | 'label' => $pluginName, |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | ], |
| 474 | 474 | [ |
| 475 | 475 | 'label' => $templateTitle, |
| 476 | - 'url' => UrlHelper::cpUrl('seomatic/content' . $siteHandleUri), |
|
| 476 | + 'url' => UrlHelper::cpUrl('seomatic/content'.$siteHandleUri), |
|
| 477 | 477 | ], |
| 478 | 478 | ]; |
| 479 | 479 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | // Get the site to edit |
| 514 | 514 | $siteId = $this->getSiteIdFromHandle($siteHandle); |
| 515 | 515 | if (is_string($typeId)) { |
| 516 | - $typeId = (int)$typeId; |
|
| 516 | + $typeId = (int) $typeId; |
|
| 517 | 517 | } |
| 518 | 518 | // Get the (entry) type menu |
| 519 | 519 | $typeMenu = []; |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | $currentType = reset($typeMenu); |
| 528 | 528 | $variables['currentType'] = $typeMenu[$typeId] ?? $currentType; |
| 529 | 529 | $variables['currentTypeId'] = $typeId ?? key($typeMenu); |
| 530 | - $typeId = (int)$variables['currentTypeId']; |
|
| 530 | + $typeId = (int) $variables['currentTypeId']; |
|
| 531 | 531 | } |
| 532 | 532 | $pluginName = Seomatic::$settings->pluginName; |
| 533 | 533 | // Asset bundle |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | // Get the site to copy the settings from, if any |
| 549 | 549 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
| 550 | 550 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
| 551 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
| 551 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
| 552 | 552 | // Load the metabundle |
| 553 | 553 | $metaBundle = Seomatic::$plugin->metaBundles->getMetaBundleBySourceHandle( |
| 554 | 554 | $sourceBundleType, |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | $variables['title'] = $templateTitle; |
| 575 | 575 | $variables['subSectionTitle'] = $subSectionTitle; |
| 576 | 576 | $variables['docTitle'] = "{$pluginName} - Content SEO - {$templateTitle} - {$subSectionTitle}"; |
| 577 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 577 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 578 | 578 | $variables['siteHandleUri'] = $siteHandleUri; |
| 579 | 579 | $variables['crumbs'] = [ |
| 580 | 580 | [ |
@@ -583,10 +583,10 @@ discard block |
||
| 583 | 583 | ], |
| 584 | 584 | [ |
| 585 | 585 | 'label' => 'Content SEO', |
| 586 | - 'url' => UrlHelper::cpUrl('seomatic/content' . $siteHandleUri), |
|
| 586 | + 'url' => UrlHelper::cpUrl('seomatic/content'.$siteHandleUri), |
|
| 587 | 587 | ], |
| 588 | 588 | [ |
| 589 | - 'label' => $metaBundle->sourceName . ' · ' . $subSectionTitle, |
|
| 589 | + 'label' => $metaBundle->sourceName.' · '.$subSectionTitle, |
|
| 590 | 590 | 'url' => UrlHelper::cpUrl("seomatic/edit-content/${subSection}/${sourceBundleType}/${sourceHandle}"), |
| 591 | 591 | ], |
| 592 | 592 | ]; |
@@ -616,13 +616,13 @@ discard block |
||
| 616 | 616 | // Preview the meta containers |
| 617 | 617 | Seomatic::$plugin->metaContainers->previewMetaContainers( |
| 618 | 618 | $uri, |
| 619 | - (int)$variables['currentSiteId'], |
|
| 619 | + (int) $variables['currentSiteId'], |
|
| 620 | 620 | false, |
| 621 | 621 | false |
| 622 | 622 | ); |
| 623 | 623 | |
| 624 | 624 | // Render the template |
| 625 | - return $this->renderTemplate('seomatic/settings/content/' . $subSection, $variables); |
|
| 625 | + return $this->renderTemplate('seomatic/settings/content/'.$subSection, $variables); |
|
| 626 | 626 | } |
| 627 | 627 | |
| 628 | 628 | /** |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | if ($subSection === 'social') { |
| 705 | 705 | $subSectionSuffix = ' Media'; |
| 706 | 706 | } |
| 707 | - $subSectionTitle = Craft::t('seomatic', ucfirst($subSection) . $subSectionSuffix); |
|
| 707 | + $subSectionTitle = Craft::t('seomatic', ucfirst($subSection).$subSectionSuffix); |
|
| 708 | 708 | // Asset bundle |
| 709 | 709 | try { |
| 710 | 710 | Seomatic::$view->registerAssetBundle(SeomaticAsset::class); |
@@ -722,7 +722,7 @@ discard block |
||
| 722 | 722 | $variables['title'] = $templateTitle; |
| 723 | 723 | $variables['subSectionTitle'] = $subSectionTitle; |
| 724 | 724 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
| 725 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 725 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 726 | 726 | $variables['crumbs'] = [ |
| 727 | 727 | [ |
| 728 | 728 | 'label' => $pluginName, |
@@ -730,11 +730,11 @@ discard block |
||
| 730 | 730 | ], |
| 731 | 731 | [ |
| 732 | 732 | 'label' => $templateTitle, |
| 733 | - 'url' => UrlHelper::cpUrl('seomatic/site/identity' . $siteHandleUri), |
|
| 733 | + 'url' => UrlHelper::cpUrl('seomatic/site/identity'.$siteHandleUri), |
|
| 734 | 734 | ], |
| 735 | 735 | [ |
| 736 | 736 | 'label' => $subSectionTitle, |
| 737 | - 'url' => UrlHelper::cpUrl('seomatic/site/' . $subSection . $siteHandleUri), |
|
| 737 | + 'url' => UrlHelper::cpUrl('seomatic/site/'.$subSection.$siteHandleUri), |
|
| 738 | 738 | ], |
| 739 | 739 | ]; |
| 740 | 740 | $variables['selectedSubnavItem'] = 'site'; |
@@ -742,14 +742,14 @@ discard block |
||
| 742 | 742 | |
| 743 | 743 | // Enabled sites |
| 744 | 744 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
| 745 | - $variables['controllerHandle'] = 'site' . '/' . $subSection; |
|
| 745 | + $variables['controllerHandle'] = 'site'.'/'.$subSection; |
|
| 746 | 746 | |
| 747 | 747 | // The site settings for the appropriate meta bundle |
| 748 | 748 | Seomatic::$previewingMetaContainers = true; |
| 749 | 749 | // Get the site to copy the settings from, if any |
| 750 | 750 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
| 751 | 751 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
| 752 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
| 752 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
| 753 | 753 | // Load the metabundle |
| 754 | 754 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
| 755 | 755 | Seomatic::$previewingMetaContainers = false; |
@@ -767,7 +767,7 @@ discard block |
||
| 767 | 767 | $variables['elementType'] = Asset::class; |
| 768 | 768 | |
| 769 | 769 | // Render the template |
| 770 | - return $this->renderTemplate('seomatic/settings/site/' . $subSection, $variables); |
|
| 770 | + return $this->renderTemplate('seomatic/settings/site/'.$subSection, $variables); |
|
| 771 | 771 | } |
| 772 | 772 | |
| 773 | 773 | /** |
@@ -898,7 +898,7 @@ discard block |
||
| 898 | 898 | $siteId = $this->getSiteIdFromHandle($siteHandle); |
| 899 | 899 | // Enabled sites |
| 900 | 900 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
| 901 | - $variables['controllerHandle'] = 'tracking' . '/' . $subSection; |
|
| 901 | + $variables['controllerHandle'] = 'tracking'.'/'.$subSection; |
|
| 902 | 902 | $variables['currentSubSection'] = $subSection; |
| 903 | 903 | |
| 904 | 904 | // The script meta containers for the global meta bundle |
@@ -906,7 +906,7 @@ discard block |
||
| 906 | 906 | // Get the site to copy the settings from, if any |
| 907 | 907 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
| 908 | 908 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
| 909 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
| 909 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
| 910 | 910 | // Load the metabundle |
| 911 | 911 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
| 912 | 912 | if ($editedMetaBundle) { |
@@ -946,7 +946,7 @@ discard block |
||
| 946 | 946 | $variables['title'] = $templateTitle; |
| 947 | 947 | $variables['subSectionTitle'] = $subSectionTitle; |
| 948 | 948 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
| 949 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 949 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 950 | 950 | $variables['crumbs'] = [ |
| 951 | 951 | [ |
| 952 | 952 | 'label' => $pluginName, |
@@ -958,7 +958,7 @@ discard block |
||
| 958 | 958 | ], |
| 959 | 959 | [ |
| 960 | 960 | 'label' => $subSectionTitle, |
| 961 | - 'url' => UrlHelper::cpUrl('seomatic/tracking/' . $subSection . $siteHandleUri), |
|
| 961 | + 'url' => UrlHelper::cpUrl('seomatic/tracking/'.$subSection.$siteHandleUri), |
|
| 962 | 962 | ], |
| 963 | 963 | ]; |
| 964 | 964 | $variables['selectedSubnavItem'] = 'tracking'; |
@@ -1097,7 +1097,7 @@ discard block |
||
| 1097 | 1097 | if ($siteHandle !== null) { |
| 1098 | 1098 | $site = Craft::$app->getSites()->getSiteByHandle($siteHandle); |
| 1099 | 1099 | if (!$site) { |
| 1100 | - throw new NotFoundHttpException('Invalid site handle: ' . $siteHandle); |
|
| 1100 | + throw new NotFoundHttpException('Invalid site handle: '.$siteHandle); |
|
| 1101 | 1101 | } |
| 1102 | 1102 | $siteId = $site->id; |
| 1103 | 1103 | } else { |
@@ -1133,7 +1133,7 @@ discard block |
||
| 1133 | 1133 | if (!empty($variables['enabledSiteIds'])) { |
| 1134 | 1134 | $siteId = reset($variables['enabledSiteIds']); |
| 1135 | 1135 | } else { |
| 1136 | - $this->requirePermission('editSite:' . $siteId); |
|
| 1136 | + $this->requirePermission('editSite:'.$siteId); |
|
| 1137 | 1137 | } |
| 1138 | 1138 | } |
| 1139 | 1139 | } |
@@ -1153,7 +1153,7 @@ discard block |
||
| 1153 | 1153 | if ($variables['showSites']) { |
| 1154 | 1154 | $variables['sitesMenuLabel'] = Craft::t( |
| 1155 | 1155 | 'site', |
| 1156 | - $sites->getSiteById((int)$variables['currentSiteId'])->name |
|
| 1156 | + $sites->getSiteById((int) $variables['currentSiteId'])->name |
|
| 1157 | 1157 | ); |
| 1158 | 1158 | } else { |
| 1159 | 1159 | $variables['sitesMenuLabel'] = ''; |
@@ -1218,7 +1218,7 @@ discard block |
||
| 1218 | 1218 | array &$variables |
| 1219 | 1219 | ) { |
| 1220 | 1220 | $variables['textFieldSources'] = array_merge( |
| 1221 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'], |
|
| 1221 | + ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'], |
|
| 1222 | 1222 | FieldHelper::fieldsOfTypeFromSource( |
| 1223 | 1223 | $sourceBundleType, |
| 1224 | 1224 | $sourceHandle, |
@@ -1227,7 +1227,7 @@ discard block |
||
| 1227 | 1227 | ) |
| 1228 | 1228 | ); |
| 1229 | 1229 | $variables['assetFieldSources'] = array_merge( |
| 1230 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields']], |
|
| 1230 | + ['entryGroup' => ['optgroup' => $groupName.' Fields']], |
|
| 1231 | 1231 | FieldHelper::fieldsOfTypeFromSource( |
| 1232 | 1232 | $sourceBundleType, |
| 1233 | 1233 | $sourceHandle, |
@@ -85,7 +85,7 @@ |
||
| 85 | 85 | } |
| 86 | 86 | // Add the Link header |
| 87 | 87 | if (!empty($canonical)) { |
| 88 | - $headerValue = '<' . $canonical . '>; rel="canonical"'; |
|
| 88 | + $headerValue = '<'.$canonical.'>; rel="canonical"'; |
|
| 89 | 89 | $response->headers->add('Link', $headerValue); |
| 90 | 90 | } |
| 91 | 91 | // Ensure the file type is allowed |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | // Constants |
| 34 | 34 | // ========================================================================= |
| 35 | 35 | |
| 36 | - const FRONTENDTEMPLATES_CONTAINER = Seomatic::SEOMATIC_HANDLE . EditableTemplate::TEMPLATE_TYPE; |
|
| 36 | + const FRONTENDTEMPLATES_CONTAINER = Seomatic::SEOMATIC_HANDLE.EditableTemplate::TEMPLATE_TYPE; |
|
| 37 | 37 | |
| 38 | 38 | const HUMANS_TXT_HANDLE = 'humans'; |
| 39 | 39 | const ROBOTS_TXT_HANDLE = 'robots'; |
@@ -171,16 +171,16 @@ discard block |
||
| 171 | 171 | $dependency = new TagDependency([ |
| 172 | 172 | 'tags' => [ |
| 173 | 173 | self::GLOBAL_FRONTENDTEMPLATE_CACHE_TAG, |
| 174 | - self::FRONTENDTEMPLATE_CACHE_TAG . $template, |
|
| 175 | - self::FRONTENDTEMPLATE_CACHE_TAG . $template . $siteId, |
|
| 174 | + self::FRONTENDTEMPLATE_CACHE_TAG.$template, |
|
| 175 | + self::FRONTENDTEMPLATE_CACHE_TAG.$template.$siteId, |
|
| 176 | 176 | ], |
| 177 | 177 | ]); |
| 178 | 178 | $cache = Craft::$app->getCache(); |
| 179 | 179 | $html = $cache->getOrSet( |
| 180 | - self::CACHE_KEY . $template . $siteId, |
|
| 180 | + self::CACHE_KEY.$template.$siteId, |
|
| 181 | 181 | function() use ($template, $params) { |
| 182 | 182 | Craft::info( |
| 183 | - 'Frontend template cache miss: ' . $template, |
|
| 183 | + 'Frontend template cache miss: '.$template, |
|
| 184 | 184 | __METHOD__ |
| 185 | 185 | ); |
| 186 | 186 | $html = ''; |
@@ -251,9 +251,9 @@ discard block |
||
| 251 | 251 | public function invalidateFrontendTemplateCache(string $template) |
| 252 | 252 | { |
| 253 | 253 | $cache = Craft::$app->getCache(); |
| 254 | - TagDependency::invalidate($cache, self::FRONTENDTEMPLATE_CACHE_TAG . $template); |
|
| 254 | + TagDependency::invalidate($cache, self::FRONTENDTEMPLATE_CACHE_TAG.$template); |
|
| 255 | 255 | Craft::info( |
| 256 | - 'Frontend template cache cleared: ' . $template, |
|
| 256 | + 'Frontend template cache cleared: '.$template, |
|
| 257 | 257 | __METHOD__ |
| 258 | 258 | ); |
| 259 | 259 | } |
@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | // Constants |
| 43 | 43 | // ========================================================================= |
| 44 | 44 | |
| 45 | - const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapIndexTemplate::TEMPLATE_TYPE; |
|
| 45 | + const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapIndexTemplate::TEMPLATE_TYPE; |
|
| 46 | 46 | |
| 47 | - const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapTemplate::TEMPLATE_TYPE; |
|
| 47 | + const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapTemplate::TEMPLATE_TYPE; |
|
| 48 | 48 | |
| 49 | - const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapCustomTemplate::TEMPLATE_TYPE; |
|
| 49 | + const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapCustomTemplate::TEMPLATE_TYPE; |
|
| 50 | 50 | |
| 51 | 51 | const SEARCH_ENGINE_SUBMISSION_URLS = [ |
| 52 | 52 | ]; |
@@ -243,19 +243,19 @@ discard block |
||
| 243 | 243 | $siteId = $groupSiteIds[0]; |
| 244 | 244 | $sitemapIndexUrl = $this->sitemapIndexUrlForSiteId($siteId); |
| 245 | 245 | if (!empty($sitemapIndexUrl)) { |
| 246 | - $submissionUrl = $url . urlencode($sitemapIndexUrl); |
|
| 246 | + $submissionUrl = $url.urlencode($sitemapIndexUrl); |
|
| 247 | 247 | // create new guzzle client |
| 248 | 248 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
| 249 | 249 | // Submit the sitemap index to each search engine |
| 250 | 250 | try { |
| 251 | 251 | $guzzleClient->post($submissionUrl); |
| 252 | 252 | Craft::info( |
| 253 | - 'Sitemap index submitted to: ' . $submissionUrl, |
|
| 253 | + 'Sitemap index submitted to: '.$submissionUrl, |
|
| 254 | 254 | __METHOD__ |
| 255 | 255 | ); |
| 256 | 256 | } catch (\Exception $e) { |
| 257 | 257 | Craft::error( |
| 258 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
| 258 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
| 259 | 259 | __METHOD__ |
| 260 | 260 | ); |
| 261 | 261 | } |
@@ -315,19 +315,19 @@ discard block |
||
| 315 | 315 | foreach ($searchEngineUrls as &$url) { |
| 316 | 316 | $sitemapUrl = $this->sitemapUrlForBundle($sourceBundleType, $sourceHandle, $sourceSiteId); |
| 317 | 317 | if (!empty($sitemapUrl)) { |
| 318 | - $submissionUrl = $url . urlencode($sitemapUrl); |
|
| 318 | + $submissionUrl = $url.urlencode($sitemapUrl); |
|
| 319 | 319 | // create new guzzle client |
| 320 | 320 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
| 321 | 321 | // Submit the sitemap index to each search engine |
| 322 | 322 | try { |
| 323 | 323 | $guzzleClient->post($submissionUrl); |
| 324 | 324 | Craft::info( |
| 325 | - 'Sitemap index submitted to: ' . $submissionUrl, |
|
| 325 | + 'Sitemap index submitted to: '.$submissionUrl, |
|
| 326 | 326 | __METHOD__ |
| 327 | 327 | ); |
| 328 | 328 | } catch (\Exception $e) { |
| 329 | 329 | Craft::error( |
| 330 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
| 330 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
| 331 | 331 | __METHOD__ |
| 332 | 332 | ); |
| 333 | 333 | } |
@@ -393,19 +393,19 @@ discard block |
||
| 393 | 393 | foreach ($searchEngineUrls as &$url) { |
| 394 | 394 | $sitemapUrl = $this->sitemapCustomUrlForSiteId($siteId); |
| 395 | 395 | if (!empty($sitemapUrl)) { |
| 396 | - $submissionUrl = $url . urlencode($sitemapUrl); |
|
| 396 | + $submissionUrl = $url.urlencode($sitemapUrl); |
|
| 397 | 397 | // create new guzzle client |
| 398 | 398 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
| 399 | 399 | // Submit the sitemap index to each search engine |
| 400 | 400 | try { |
| 401 | 401 | $guzzleClient->post($submissionUrl); |
| 402 | 402 | Craft::info( |
| 403 | - 'Sitemap Custom submitted to: ' . $submissionUrl, |
|
| 403 | + 'Sitemap Custom submitted to: '.$submissionUrl, |
|
| 404 | 404 | __METHOD__ |
| 405 | 405 | ); |
| 406 | 406 | } catch (\Exception $e) { |
| 407 | 407 | Craft::error( |
| 408 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
| 408 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
| 409 | 409 | __METHOD__ |
| 410 | 410 | ); |
| 411 | 411 | } |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | foreach ($sites as $site) { |
| 486 | - $result .= 'sitemap: ' . $this->sitemapIndexUrlForSiteId($site->id) . PHP_EOL; |
|
| 486 | + $result .= 'sitemap: '.$this->sitemapIndexUrlForSiteId($site->id).PHP_EOL; |
|
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | return rtrim($result, PHP_EOL); |
@@ -515,9 +515,9 @@ discard block |
||
| 515 | 515 | // Since we want a stale-while-revalidate pattern, only invalidate the cache if we're asked to |
| 516 | 516 | if ($invalidateCache) { |
| 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 | } |
@@ -388,7 +388,7 @@ |
||
| 388 | 388 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
| 389 | 389 | [ |
| 390 | 390 | 'sourceId' => $sourceModel->id, |
| 391 | - 'sourceName' => (string)$sourceModel->name, |
|
| 391 | + 'sourceName' => (string) $sourceModel->name, |
|
| 392 | 392 | 'sourceHandle' => $sourceModel->handle, |
| 393 | 393 | ] |
| 394 | 394 | ); |
@@ -128,16 +128,16 @@ discard block |
||
| 128 | 128 | $dependency = new TagDependency([ |
| 129 | 129 | 'tags' => [ |
| 130 | 130 | self::GLOBAL_SITEMAP_CACHE_TAG, |
| 131 | - self::SITEMAP_CACHE_TAG . $handle . $siteId, |
|
| 131 | + self::SITEMAP_CACHE_TAG.$handle.$siteId, |
|
| 132 | 132 | ], |
| 133 | 133 | ]); |
| 134 | 134 | |
| 135 | - return $cache->getOrSet(self::CACHE_KEY . $groupId . self::CUSTOM_SCOPE . $handle . $siteId, function() use ( |
|
| 135 | + return $cache->getOrSet(self::CACHE_KEY.$groupId.self::CUSTOM_SCOPE.$handle.$siteId, function() use ( |
|
| 136 | 136 | $handle, |
| 137 | 137 | $siteId |
| 138 | 138 | ) { |
| 139 | 139 | Craft::info( |
| 140 | - 'Sitemap Custom cache miss: ' . $handle . '/' . $siteId, |
|
| 140 | + 'Sitemap Custom cache miss: '.$handle.'/'.$siteId, |
|
| 141 | 141 | __METHOD__ |
| 142 | 142 | ); |
| 143 | 143 | $lines = []; |
@@ -212,9 +212,9 @@ discard block |
||
| 212 | 212 | { |
| 213 | 213 | $handle = self::CUSTOM_HANDLE; |
| 214 | 214 | $cache = Craft::$app->getCache(); |
| 215 | - TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG . $handle . $siteId); |
|
| 215 | + TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG.$handle.$siteId); |
|
| 216 | 216 | Craft::info( |
| 217 | - 'Sitemap Custom cache cleared: ' . $handle, |
|
| 217 | + 'Sitemap Custom cache cleared: '.$handle, |
|
| 218 | 218 | __METHOD__ |
| 219 | 219 | ); |
| 220 | 220 | } |
@@ -51,16 +51,16 @@ |
||
| 51 | 51 | public function includeMetaData($dependency) |
| 52 | 52 | { |
| 53 | 53 | Craft::beginProfile('MetaJsonLdContainer::includeMetaData', __METHOD__); |
| 54 | - $uniqueKey = $this->handle . $dependency->tags[3] . '-v2'; |
|
| 54 | + $uniqueKey = $this->handle.$dependency->tags[3].'-v2'; |
|
| 55 | 55 | $cache = Craft::$app->getCache(); |
| 56 | 56 | if ($this->clearCache) { |
| 57 | 57 | TagDependency::invalidate($cache, $dependency->tags[3]); |
| 58 | 58 | } |
| 59 | 59 | [$jsonLd, $attrs] = $cache->getOrSet( |
| 60 | - self::CONTAINER_TYPE . $uniqueKey, |
|
| 60 | + self::CONTAINER_TYPE.$uniqueKey, |
|
| 61 | 61 | function() use ($uniqueKey) { |
| 62 | 62 | Craft::info( |
| 63 | - self::CONTAINER_TYPE . ' cache miss: ' . $uniqueKey, |
|
| 63 | + self::CONTAINER_TYPE.' cache miss: '.$uniqueKey, |
|
| 64 | 64 | __METHOD__ |
| 65 | 65 | ); |
| 66 | 66 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function getFilename(int $groupId): string |
| 118 | 118 | { |
| 119 | - return 'sitemaps-' . $groupId . '-sitemap.xml'; |
|
| 119 | + return 'sitemaps-'.$groupId.'-sitemap.xml'; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | ], |
| 150 | 150 | ]); |
| 151 | 151 | |
| 152 | - return $cache->getOrSet(self::CACHE_KEY . $groupId . '.' . $siteId, function() use ($groupSiteIds, $siteId) { |
|
| 152 | + return $cache->getOrSet(self::CACHE_KEY.$groupId.'.'.$siteId, function() use ($groupSiteIds, $siteId) { |
|
| 153 | 153 | Craft::info( |
| 154 | 154 | 'Sitemap index cache miss', |
| 155 | 155 | __METHOD__ |