@@ -17,10 +17,10 @@ |
||
| 17 | 17 | { |
| 18 | 18 | if (version_compare(Craft::$app->getVersion(), '3.7', '>=')) { |
| 19 | 19 | Craft::$app->announcements->push( |
| 20 | - function ($language) { |
|
| 20 | + function($language) { |
|
| 21 | 21 | return Craft::t('seomatic', 'SEO Settings fields', [], $language); |
| 22 | 22 | }, |
| 23 | - function ($language) { |
|
| 23 | + function($language) { |
|
| 24 | 24 | return Craft::t('seomatic', 'The [SEO Settings]({url}) fields now feature **Override** lightswitches next to each setting, letting you explicitly override SEO settings on a per-entry basis.', [ |
| 25 | 25 | 'url' => 'https://nystudio107.com/docs/seomatic/fields.html', |
| 26 | 26 | ], $language); |
@@ -99,16 +99,16 @@ |
||
| 99 | 99 | { |
| 100 | 100 | // Enforce types |
| 101 | 101 | if ($this->sitemapUrls !== null) { |
| 102 | - $this->sitemapUrls = (bool)$this->sitemapUrls; |
|
| 102 | + $this->sitemapUrls = (bool) $this->sitemapUrls; |
|
| 103 | 103 | } |
| 104 | 104 | if ($this->sitemapAssets !== null) { |
| 105 | - $this->sitemapAssets = (bool)$this->sitemapAssets; |
|
| 105 | + $this->sitemapAssets = (bool) $this->sitemapAssets; |
|
| 106 | 106 | } |
| 107 | 107 | if ($this->sitemapFiles !== null) { |
| 108 | - $this->sitemapFiles = (bool)$this->sitemapFiles; |
|
| 108 | + $this->sitemapFiles = (bool) $this->sitemapFiles; |
|
| 109 | 109 | } |
| 110 | 110 | if ($this->sitemapAltLinks !== null) { |
| 111 | - $this->sitemapAltLinks = (bool)$this->sitemapAltLinks; |
|
| 111 | + $this->sitemapAltLinks = (bool) $this->sitemapAltLinks; |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
@@ -599,8 +599,8 @@ |
||
| 599 | 599 | string $sourceBundleType, |
| 600 | 600 | string $sourceHandle, |
| 601 | 601 | string $siteHandle = null, |
| 602 | - $typeId = null, |
|
| 603 | - $loadFromSiteHandle = null |
|
| 602 | + $typeId = null, |
|
| 603 | + $loadFromSiteHandle = null |
|
| 604 | 604 | ): Response |
| 605 | 605 | { |
| 606 | 606 | $variables = []; |
@@ -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); |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | if ($siteHandle !== null) { |
| 233 | 233 | $site = Craft::$app->getSites()->getSiteByHandle($siteHandle); |
| 234 | 234 | if (!$site) { |
| 235 | - throw new NotFoundHttpException('Invalid site handle: ' . $siteHandle); |
|
| 235 | + throw new NotFoundHttpException('Invalid site handle: '.$siteHandle); |
|
| 236 | 236 | } |
| 237 | 237 | $siteId = $site->id; |
| 238 | 238 | } else { |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | if (!empty($variables['enabledSiteIds'])) { |
| 270 | 270 | $siteId = reset($variables['enabledSiteIds']); |
| 271 | 271 | } else { |
| 272 | - $this->requirePermission('editSite:' . $siteId); |
|
| 272 | + $this->requirePermission('editSite:'.$siteId); |
|
| 273 | 273 | } |
| 274 | 274 | } |
| 275 | 275 | } |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | if ($variables['showSites']) { |
| 290 | 290 | $variables['sitesMenuLabel'] = Craft::t( |
| 291 | 291 | 'site', |
| 292 | - $sites->getSiteById((int)$variables['currentSiteId'])->name |
|
| 292 | + $sites->getSiteById((int) $variables['currentSiteId'])->name |
|
| 293 | 293 | ); |
| 294 | 294 | } else { |
| 295 | 295 | $variables['sitesMenuLabel'] = ''; |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | $variables['title'] = $templateTitle; |
| 333 | 333 | $variables['subSectionTitle'] = $subSectionTitle; |
| 334 | 334 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
| 335 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 335 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 336 | 336 | $variables['crumbs'] = [ |
| 337 | 337 | [ |
| 338 | 338 | 'label' => $pluginName, |
@@ -340,11 +340,11 @@ discard block |
||
| 340 | 340 | ], |
| 341 | 341 | [ |
| 342 | 342 | 'label' => $templateTitle, |
| 343 | - 'url' => UrlHelper::cpUrl('seomatic/global/general' . $siteHandleUri), |
|
| 343 | + 'url' => UrlHelper::cpUrl('seomatic/global/general'.$siteHandleUri), |
|
| 344 | 344 | ], |
| 345 | 345 | [ |
| 346 | 346 | 'label' => $subSectionTitle, |
| 347 | - 'url' => UrlHelper::cpUrl('seomatic/global/' . $subSection . $siteHandleUri), |
|
| 347 | + 'url' => UrlHelper::cpUrl('seomatic/global/'.$subSection.$siteHandleUri), |
|
| 348 | 348 | ], |
| 349 | 349 | ]; |
| 350 | 350 | $variables['selectedSubnavItem'] = 'global'; |
@@ -352,14 +352,14 @@ discard block |
||
| 352 | 352 | $this->setGlobalFieldSourceVariables($variables); |
| 353 | 353 | // Enabled sites |
| 354 | 354 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
| 355 | - $variables['controllerHandle'] = 'global' . '/' . $subSection; |
|
| 355 | + $variables['controllerHandle'] = 'global'.'/'.$subSection; |
|
| 356 | 356 | $variables['currentSubSection'] = $subSection; |
| 357 | 357 | // Meta bundle settings |
| 358 | 358 | Seomatic::$previewingMetaContainers = true; |
| 359 | 359 | // Get the site to copy the settings from, if any |
| 360 | 360 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
| 361 | 361 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
| 362 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
| 362 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
| 363 | 363 | // Load the metabundle |
| 364 | 364 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
| 365 | 365 | if ($editedMetaBundle) { |
@@ -413,11 +413,11 @@ discard block |
||
| 413 | 413 | // Preview the meta containers |
| 414 | 414 | Seomatic::$plugin->metaContainers->previewMetaContainers( |
| 415 | 415 | MetaBundles::GLOBAL_META_BUNDLE, |
| 416 | - (int)$variables['currentSiteId'] |
|
| 416 | + (int) $variables['currentSiteId'] |
|
| 417 | 417 | ); |
| 418 | 418 | |
| 419 | 419 | // Render the template |
| 420 | - return $this->renderTemplate('seomatic/settings/global/' . $subSection, $variables); |
|
| 420 | + return $this->renderTemplate('seomatic/settings/global/'.$subSection, $variables); |
|
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | /** |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | $variables['pluginName'] = Seomatic::$settings->pluginName; |
| 560 | 560 | $variables['title'] = $templateTitle; |
| 561 | 561 | $variables['docTitle'] = "{$pluginName} - {$templateTitle}"; |
| 562 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 562 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 563 | 563 | $variables['crumbs'] = [ |
| 564 | 564 | [ |
| 565 | 565 | 'label' => $pluginName, |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | ], |
| 568 | 568 | [ |
| 569 | 569 | 'label' => $templateTitle, |
| 570 | - 'url' => UrlHelper::cpUrl('seomatic/content' . $siteHandleUri), |
|
| 570 | + 'url' => UrlHelper::cpUrl('seomatic/content'.$siteHandleUri), |
|
| 571 | 571 | ], |
| 572 | 572 | ]; |
| 573 | 573 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | // Get the site to edit |
| 609 | 609 | $siteId = $this->getSiteIdFromHandle($siteHandle); |
| 610 | 610 | if ($typeId !== null && is_string($typeId)) { |
| 611 | - $typeId = (int)$typeId; |
|
| 611 | + $typeId = (int) $typeId; |
|
| 612 | 612 | } |
| 613 | 613 | // Get the (entry) type menu |
| 614 | 614 | $typeMenu = []; |
@@ -622,7 +622,7 @@ discard block |
||
| 622 | 622 | $currentType = reset($typeMenu); |
| 623 | 623 | $variables['currentType'] = $typeMenu[$typeId] ?? $currentType; |
| 624 | 624 | $variables['currentTypeId'] = $typeId ?? key($typeMenu); |
| 625 | - $typeId = (int)$variables['currentTypeId']; |
|
| 625 | + $typeId = (int) $variables['currentTypeId']; |
|
| 626 | 626 | } |
| 627 | 627 | $pluginName = Seomatic::$settings->pluginName; |
| 628 | 628 | // Asset bundle |
@@ -643,7 +643,7 @@ discard block |
||
| 643 | 643 | // Get the site to copy the settings from, if any |
| 644 | 644 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
| 645 | 645 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
| 646 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
| 646 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
| 647 | 647 | // Load the metabundle |
| 648 | 648 | $metaBundle = Seomatic::$plugin->metaBundles->getMetaBundleBySourceHandle( |
| 649 | 649 | $sourceBundleType, |
@@ -669,7 +669,7 @@ discard block |
||
| 669 | 669 | $variables['title'] = $templateTitle; |
| 670 | 670 | $variables['subSectionTitle'] = $subSectionTitle; |
| 671 | 671 | $variables['docTitle'] = "{$pluginName} - Content SEO - {$templateTitle} - {$subSectionTitle}"; |
| 672 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 672 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 673 | 673 | $variables['siteHandleUri'] = $siteHandleUri; |
| 674 | 674 | $variables['crumbs'] = [ |
| 675 | 675 | [ |
@@ -678,10 +678,10 @@ discard block |
||
| 678 | 678 | ], |
| 679 | 679 | [ |
| 680 | 680 | 'label' => 'Content SEO', |
| 681 | - 'url' => UrlHelper::cpUrl('seomatic/content' . $siteHandleUri), |
|
| 681 | + 'url' => UrlHelper::cpUrl('seomatic/content'.$siteHandleUri), |
|
| 682 | 682 | ], |
| 683 | 683 | [ |
| 684 | - 'label' => $metaBundle->sourceName . ' · ' . $subSectionTitle, |
|
| 684 | + 'label' => $metaBundle->sourceName.' · '.$subSectionTitle, |
|
| 685 | 685 | 'url' => UrlHelper::cpUrl("seomatic/edit-content/${subSection}/${sourceBundleType}/${sourceHandle}"), |
| 686 | 686 | ], |
| 687 | 687 | ]; |
@@ -711,13 +711,13 @@ discard block |
||
| 711 | 711 | // Preview the meta containers |
| 712 | 712 | Seomatic::$plugin->metaContainers->previewMetaContainers( |
| 713 | 713 | $uri, |
| 714 | - (int)$variables['currentSiteId'], |
|
| 714 | + (int) $variables['currentSiteId'], |
|
| 715 | 715 | false, |
| 716 | 716 | false |
| 717 | 717 | ); |
| 718 | 718 | |
| 719 | 719 | // Render the template |
| 720 | - return $this->renderTemplate('seomatic/settings/content/' . $subSection, $variables); |
|
| 720 | + return $this->renderTemplate('seomatic/settings/content/'.$subSection, $variables); |
|
| 721 | 721 | } |
| 722 | 722 | |
| 723 | 723 | /** |
@@ -758,7 +758,7 @@ discard block |
||
| 758 | 758 | ) |
| 759 | 759 | { |
| 760 | 760 | $variables['textFieldSources'] = array_merge( |
| 761 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'], |
|
| 761 | + ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'], |
|
| 762 | 762 | FieldHelper::fieldsOfTypeFromSource( |
| 763 | 763 | $sourceBundleType, |
| 764 | 764 | $sourceHandle, |
@@ -767,7 +767,7 @@ discard block |
||
| 767 | 767 | ) |
| 768 | 768 | ); |
| 769 | 769 | $variables['assetFieldSources'] = array_merge( |
| 770 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields']], |
|
| 770 | + ['entryGroup' => ['optgroup' => $groupName.' Fields']], |
|
| 771 | 771 | FieldHelper::fieldsOfTypeFromSource( |
| 772 | 772 | $sourceBundleType, |
| 773 | 773 | $sourceHandle, |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | if ($subSection === 'social') { |
| 903 | 903 | $subSectionSuffix = ' Media'; |
| 904 | 904 | } |
| 905 | - $subSectionTitle = Craft::t('seomatic', ucfirst($subSection) . $subSectionSuffix); |
|
| 905 | + $subSectionTitle = Craft::t('seomatic', ucfirst($subSection).$subSectionSuffix); |
|
| 906 | 906 | // Asset bundle |
| 907 | 907 | try { |
| 908 | 908 | Seomatic::$view->registerAssetBundle(SeomaticAsset::class); |
@@ -920,7 +920,7 @@ discard block |
||
| 920 | 920 | $variables['title'] = $templateTitle; |
| 921 | 921 | $variables['subSectionTitle'] = $subSectionTitle; |
| 922 | 922 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
| 923 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 923 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 924 | 924 | $variables['crumbs'] = [ |
| 925 | 925 | [ |
| 926 | 926 | 'label' => $pluginName, |
@@ -928,11 +928,11 @@ discard block |
||
| 928 | 928 | ], |
| 929 | 929 | [ |
| 930 | 930 | 'label' => $templateTitle, |
| 931 | - 'url' => UrlHelper::cpUrl('seomatic/site/identity' . $siteHandleUri), |
|
| 931 | + 'url' => UrlHelper::cpUrl('seomatic/site/identity'.$siteHandleUri), |
|
| 932 | 932 | ], |
| 933 | 933 | [ |
| 934 | 934 | 'label' => $subSectionTitle, |
| 935 | - 'url' => UrlHelper::cpUrl('seomatic/site/' . $subSection . $siteHandleUri), |
|
| 935 | + 'url' => UrlHelper::cpUrl('seomatic/site/'.$subSection.$siteHandleUri), |
|
| 936 | 936 | ], |
| 937 | 937 | ]; |
| 938 | 938 | $variables['selectedSubnavItem'] = 'site'; |
@@ -940,14 +940,14 @@ discard block |
||
| 940 | 940 | |
| 941 | 941 | // Enabled sites |
| 942 | 942 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
| 943 | - $variables['controllerHandle'] = 'site' . '/' . $subSection; |
|
| 943 | + $variables['controllerHandle'] = 'site'.'/'.$subSection; |
|
| 944 | 944 | |
| 945 | 945 | // The site settings for the appropriate meta bundle |
| 946 | 946 | Seomatic::$previewingMetaContainers = true; |
| 947 | 947 | // Get the site to copy the settings from, if any |
| 948 | 948 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
| 949 | 949 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
| 950 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
| 950 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
| 951 | 951 | // Load the metabundle |
| 952 | 952 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
| 953 | 953 | Seomatic::$previewingMetaContainers = false; |
@@ -965,7 +965,7 @@ discard block |
||
| 965 | 965 | $variables['elementType'] = Asset::class; |
| 966 | 966 | |
| 967 | 967 | // Render the template |
| 968 | - return $this->renderTemplate('seomatic/settings/site/' . $subSection, $variables); |
|
| 968 | + return $this->renderTemplate('seomatic/settings/site/'.$subSection, $variables); |
|
| 969 | 969 | } |
| 970 | 970 | |
| 971 | 971 | /** |
@@ -1110,7 +1110,7 @@ discard block |
||
| 1110 | 1110 | $siteId = $this->getSiteIdFromHandle($siteHandle); |
| 1111 | 1111 | // Enabled sites |
| 1112 | 1112 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
| 1113 | - $variables['controllerHandle'] = 'tracking' . '/' . $subSection; |
|
| 1113 | + $variables['controllerHandle'] = 'tracking'.'/'.$subSection; |
|
| 1114 | 1114 | $variables['currentSubSection'] = $subSection; |
| 1115 | 1115 | |
| 1116 | 1116 | // The script meta containers for the global meta bundle |
@@ -1118,7 +1118,7 @@ discard block |
||
| 1118 | 1118 | // Get the site to copy the settings from, if any |
| 1119 | 1119 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
| 1120 | 1120 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
| 1121 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
| 1121 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
| 1122 | 1122 | // Load the metabundle |
| 1123 | 1123 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
| 1124 | 1124 | if ($editedMetaBundle) { |
@@ -1156,7 +1156,7 @@ discard block |
||
| 1156 | 1156 | $variables['title'] = $templateTitle; |
| 1157 | 1157 | $variables['subSectionTitle'] = $subSectionTitle; |
| 1158 | 1158 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
| 1159 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
| 1159 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
| 1160 | 1160 | $variables['crumbs'] = [ |
| 1161 | 1161 | [ |
| 1162 | 1162 | 'label' => $pluginName, |
@@ -1168,7 +1168,7 @@ discard block |
||
| 1168 | 1168 | ], |
| 1169 | 1169 | [ |
| 1170 | 1170 | 'label' => $subSectionTitle, |
| 1171 | - 'url' => UrlHelper::cpUrl('seomatic/tracking/' . $subSection . $siteHandleUri), |
|
| 1171 | + 'url' => UrlHelper::cpUrl('seomatic/tracking/'.$subSection.$siteHandleUri), |
|
| 1172 | 1172 | ], |
| 1173 | 1173 | ]; |
| 1174 | 1174 | $variables['selectedSubnavItem'] = 'tracking'; |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | BaseEvent::on( |
| 85 | 85 | CalendarsService::class, |
| 86 | 86 | CalendarsService::EVENT_AFTER_SAVE, |
| 87 | - function (SaveModelEvent $event) { |
|
| 87 | + function(SaveModelEvent $event) { |
|
| 88 | 88 | Craft::debug( |
| 89 | 89 | 'CalendarsService::EVENT_AFTER_DELETE', |
| 90 | 90 | __METHOD__ |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | BaseEvent::on( |
| 96 | 96 | CalendarsService::class, |
| 97 | 97 | CalendarsService::EVENT_AFTER_DELETE, |
| 98 | - function (SaveModelEvent $event) { |
|
| 98 | + function(SaveModelEvent $event) { |
|
| 99 | 99 | Craft::debug( |
| 100 | 100 | 'CalendarsService::EVENT_AFTER_DELETE', |
| 101 | 101 | __METHOD__ |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | BaseEvent::on( |
| 111 | 111 | CalendarsService::class, |
| 112 | 112 | CalendarsService::EVENT_AFTER_SAVE, |
| 113 | - function (SaveModelEvent $event) { |
|
| 113 | + function(SaveModelEvent $event) { |
|
| 114 | 114 | Craft::debug( |
| 115 | 115 | 'CalendarsService::EVENT_AFTER_SAVE', |
| 116 | 116 | __METHOD__ |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | BaseEvent::on( |
| 136 | 136 | CalendarsService::class, |
| 137 | 137 | CalendarsService::EVENT_AFTER_DELETE, |
| 138 | - function (DeleteModelEvent $event) { |
|
| 138 | + function(DeleteModelEvent $event) { |
|
| 139 | 139 | Craft::debug( |
| 140 | 140 | 'CalendarsService::EVENT_AFTER_DELETE', |
| 141 | 141 | __METHOD__ |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | // Install only for non-console Control Panel requests |
| 166 | 166 | if ($request->getIsCpRequest() && !$request->getIsConsoleRequest()) { |
| 167 | 167 | // Events sidebar |
| 168 | - Seomatic::$view->hook('cp.solspace.calendar.events.edit.details', function (&$context) { |
|
| 168 | + Seomatic::$view->hook('cp.solspace.calendar.events.edit.details', function(&$context) { |
|
| 169 | 169 | $html = ''; |
| 170 | 170 | Seomatic::$view->registerAssetBundle(SeomaticAsset::class); |
| 171 | 171 | /** @var Event $event */ |
@@ -238,8 +238,8 @@ discard block |
||
| 238 | 238 | $query = Event::find() |
| 239 | 239 | ->setCalendar($metaBundle->sourceHandle) |
| 240 | 240 | ->setLoadOccurrences(false) |
| 241 | - ->siteId((int)$metaBundle->sourceSiteId) |
|
| 242 | - ->limit((int)$metaBundle->metaSitemapVars->sitemapLimit); |
|
| 241 | + ->siteId((int) $metaBundle->sourceSiteId) |
|
| 242 | + ->limit((int) $metaBundle->metaSitemapVars->sitemapLimit); |
|
| 243 | 243 | |
| 244 | 244 | return $query; |
| 245 | 245 | } |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
| 401 | 401 | [ |
| 402 | 402 | 'sourceId' => $sourceModel->id, |
| 403 | - 'sourceName' => (string)$sourceModel->name, |
|
| 403 | + 'sourceName' => (string) $sourceModel->name, |
|
| 404 | 404 | 'sourceHandle' => $sourceModel->handle, |
| 405 | 405 | ] |
| 406 | 406 | ); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | // Add a URL to the schema.org type if this is a MetaJsonLD object |
| 158 | 158 | if ($isMetaJsonLdModel) { |
| 159 | 159 | /** @var $this MetaJsonLd */ |
| 160 | - $extraInfo = ' for http://schema.org/' . $this->type; |
|
| 160 | + $extraInfo = ' for http://schema.org/'.$this->type; |
|
| 161 | 161 | } |
| 162 | 162 | $errorMsg = |
| 163 | 163 | Craft::t('seomatic', 'Scenario: "') |
@@ -168,10 +168,10 @@ discard block |
||
| 168 | 168 | . print_r($this->render(), true); |
| 169 | 169 | Craft::info($errorMsg, __METHOD__); |
| 170 | 170 | foreach ($this->errors as $param => $errors) { |
| 171 | - $errorMsg = Craft::t('seomatic', $errorLabel) . $param; |
|
| 171 | + $errorMsg = Craft::t('seomatic', $errorLabel).$param; |
|
| 172 | 172 | /** @var array $errors */ |
| 173 | 173 | foreach ($errors as $error) { |
| 174 | - $errorMsg .= ' -> ' . $error; |
|
| 174 | + $errorMsg .= ' -> '.$error; |
|
| 175 | 175 | // Change the error level depending on the error message if this is a MetaJsonLD object |
| 176 | 176 | if ($isMetaJsonLdModel) { |
| 177 | 177 | if (strpos($error, 'recommended') !== false) { |
@@ -190,9 +190,9 @@ discard block |
||
| 190 | 190 | /** @var MetaJsonLd $className */ |
| 191 | 191 | $className = \get_class($this); |
| 192 | 192 | if (!empty($className::$schemaPropertyDescriptions[$param])) { |
| 193 | - $errorMsg = Craft::t('seomatic', $errorLabel) . $param; |
|
| 193 | + $errorMsg = Craft::t('seomatic', $errorLabel).$param; |
|
| 194 | 194 | /** @var $className MetaJsonLd */ |
| 195 | - $errorMsg .= ' -> ' . $className::$schemaPropertyDescriptions[$param]; |
|
| 195 | + $errorMsg .= ' -> '.$className::$schemaPropertyDescriptions[$param]; |
|
| 196 | 196 | Craft::info($errorMsg, __METHOD__); |
| 197 | 197 | } |
| 198 | 198 | } |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | } |
| 215 | 215 | if (!empty($attrs) && ArrayHelper::isIndexed($attrs, true)) { |
| 216 | 216 | $attrs = []; |
| 217 | - foreach($this->tagAttrs as $attr) { |
|
| 217 | + foreach ($this->tagAttrs as $attr) { |
|
| 218 | 218 | $attrs[$attr['name']] = $attr['value']; |
| 219 | 219 | } |
| 220 | 220 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | ]; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - array_walk($containerItems, function (&$contents, $type) use ($typeMap) { |
|
| 60 | + array_walk($containerItems, function(&$contents, $type) use ($typeMap) { |
|
| 61 | 61 | $contents = [ |
| 62 | 62 | 'filename' => $typeMap[$type], |
| 63 | 63 | 'contents' => $contents |
@@ -111,12 +111,12 @@ |
||
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
| 114 | - * Get all the sitemap index items by params. |
|
| 115 | - * |
|
| 116 | - * @param array $params |
|
| 117 | - * @return array |
|
| 118 | - * @throws \yii\web\NotFoundHttpException |
|
| 119 | - */ |
|
| 114 | + * Get all the sitemap index items by params. |
|
| 115 | + * |
|
| 116 | + * @param array $params |
|
| 117 | + * @return array |
|
| 118 | + * @throws \yii\web\NotFoundHttpException |
|
| 119 | + */ |
|
| 120 | 120 | public static function getSitemapStyles($source, $arguments, $context, ResolveInfo $resolveInfo): array |
| 121 | 121 | { |
| 122 | 122 | return [ |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | // If either of the source bundle arguments are present, get the sitemap |
| 56 | - if (!empty($arguments['sourceBundleType']) || !empty($arguments['sourceBundleHandle'])) { |
|
| 56 | + if (!empty($arguments['sourceBundleType']) || !empty($arguments['sourceBundleHandle'])) { |
|
| 57 | 57 | $filename = self::createFilenameFromComponents($site->groupId, $arguments['sourceBundleType'] ?? '', $arguments['sourceBundleHandle'] ?? '', $siteId); |
| 58 | 58 | |
| 59 | 59 | return [ |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | 'name' => static::getName(), |
| 81 | 81 | 'fields' => self::class.'::getFieldDefinitions', |
| 82 | 82 | 'description' => 'This is the interface implemented by SEOmatic.', |
| 83 | - 'resolveType' => function (array $value) { |
|
| 83 | + 'resolveType' => function(array $value) { |
|
| 84 | 84 | return GqlEntityRegistry::getEntity(SeomaticGenerator::getName()); |
| 85 | 85 | }, |
| 86 | 86 | ])); |
@@ -119,27 +119,27 @@ discard block |
||
| 119 | 119 | 'name' => 'sitemaps', |
| 120 | 120 | 'args' => SitemapArguments::getArguments(), |
| 121 | 121 | 'type' => Type::listOf(FileContentsType::getType()), |
| 122 | - 'resolve' => SitemapResolver::class .'::getSitemaps' |
|
| 122 | + 'resolve' => SitemapResolver::class.'::getSitemaps' |
|
| 123 | 123 | ]; |
| 124 | 124 | |
| 125 | 125 | $fields['sitemapIndexes'] = [ |
| 126 | 126 | 'name' => 'sitemapIndexes', |
| 127 | 127 | 'args' => SitemapIndexArguments::getArguments(), |
| 128 | 128 | 'type' => Type::listOf(FileContentsType::getType()), |
| 129 | - 'resolve' => SitemapResolver::class .'::getSitemapIndexes' |
|
| 129 | + 'resolve' => SitemapResolver::class.'::getSitemapIndexes' |
|
| 130 | 130 | ]; |
| 131 | 131 | |
| 132 | 132 | $fields['sitemapStyles'] = [ |
| 133 | 133 | 'name' => 'sitemapStyles', |
| 134 | 134 | 'type' => FileContentsType::getType(), |
| 135 | - 'resolve' => SitemapResolver::class .'::getSitemapStyles' |
|
| 135 | + 'resolve' => SitemapResolver::class.'::getSitemapStyles' |
|
| 136 | 136 | ]; |
| 137 | 137 | |
| 138 | 138 | $fields['frontendTemplates'] = [ |
| 139 | 139 | 'name' => 'frontendTemplates', |
| 140 | 140 | 'args' => FrontendContainerArguments::getArguments(), |
| 141 | 141 | 'type' => Type::listOf(FileContentsType::getType()), |
| 142 | - 'resolve' => FrontendContainerResolver::class .'::getContainerFiles' |
|
| 142 | + 'resolve' => FrontendContainerResolver::class.'::getContainerFiles' |
|
| 143 | 143 | ]; |
| 144 | 144 | |
| 145 | 145 | return $fields; |
@@ -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__ |