@@ -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 | /** |
@@ -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 | /** |
@@ -905,7 +905,7 @@ discard block |
||
905 | 905 | $siteId = $this->getSiteIdFromHandle($siteHandle); |
906 | 906 | // Enabled sites |
907 | 907 | $this->setMultiSiteVariables($siteHandle, $siteId, $variables); |
908 | - $variables['controllerHandle'] = 'tracking' . '/' . $subSection; |
|
908 | + $variables['controllerHandle'] = 'tracking'.'/'.$subSection; |
|
909 | 909 | $variables['currentSubSection'] = $subSection; |
910 | 910 | |
911 | 911 | // The script meta containers for the global meta bundle |
@@ -913,7 +913,7 @@ discard block |
||
913 | 913 | // Get the site to copy the settings from, if any |
914 | 914 | $variables['loadFromSiteHandle'] = $loadFromSiteHandle; |
915 | 915 | $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle); |
916 | - $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId; |
|
916 | + $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId; |
|
917 | 917 | // Load the metabundle |
918 | 918 | $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad); |
919 | 919 | if ($editedMetaBundle) { |
@@ -953,7 +953,7 @@ discard block |
||
953 | 953 | $variables['title'] = $templateTitle; |
954 | 954 | $variables['subSectionTitle'] = $subSectionTitle; |
955 | 955 | $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}"; |
956 | - $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : ''; |
|
956 | + $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : ''; |
|
957 | 957 | $variables['crumbs'] = [ |
958 | 958 | [ |
959 | 959 | 'label' => $pluginName, |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | ], |
966 | 966 | [ |
967 | 967 | 'label' => $subSectionTitle, |
968 | - 'url' => UrlHelper::cpUrl('seomatic/tracking/' . $subSection . $siteHandleUri), |
|
968 | + 'url' => UrlHelper::cpUrl('seomatic/tracking/'.$subSection.$siteHandleUri), |
|
969 | 969 | ], |
970 | 970 | ]; |
971 | 971 | $variables['selectedSubnavItem'] = 'tracking'; |
@@ -1104,7 +1104,7 @@ discard block |
||
1104 | 1104 | if ($siteHandle !== null) { |
1105 | 1105 | $site = Craft::$app->getSites()->getSiteByHandle($siteHandle); |
1106 | 1106 | if (!$site) { |
1107 | - throw new NotFoundHttpException('Invalid site handle: ' . $siteHandle); |
|
1107 | + throw new NotFoundHttpException('Invalid site handle: '.$siteHandle); |
|
1108 | 1108 | } |
1109 | 1109 | $siteId = $site->id; |
1110 | 1110 | } else { |
@@ -1140,7 +1140,7 @@ discard block |
||
1140 | 1140 | if (!empty($variables['enabledSiteIds'])) { |
1141 | 1141 | $siteId = reset($variables['enabledSiteIds']); |
1142 | 1142 | } else { |
1143 | - $this->requirePermission('editSite:' . $siteId); |
|
1143 | + $this->requirePermission('editSite:'.$siteId); |
|
1144 | 1144 | } |
1145 | 1145 | } |
1146 | 1146 | } |
@@ -1160,7 +1160,7 @@ discard block |
||
1160 | 1160 | if ($variables['showSites']) { |
1161 | 1161 | $variables['sitesMenuLabel'] = Craft::t( |
1162 | 1162 | 'site', |
1163 | - $sites->getSiteById((int)$variables['currentSiteId'])->name |
|
1163 | + $sites->getSiteById((int) $variables['currentSiteId'])->name |
|
1164 | 1164 | ); |
1165 | 1165 | } else { |
1166 | 1166 | $variables['sitesMenuLabel'] = ''; |
@@ -1225,7 +1225,7 @@ discard block |
||
1225 | 1225 | array &$variables |
1226 | 1226 | ) { |
1227 | 1227 | $variables['textFieldSources'] = array_merge( |
1228 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'], |
|
1228 | + ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'], |
|
1229 | 1229 | FieldHelper::fieldsOfTypeFromSource( |
1230 | 1230 | $sourceBundleType, |
1231 | 1231 | $sourceHandle, |
@@ -1234,7 +1234,7 @@ discard block |
||
1234 | 1234 | ) |
1235 | 1235 | ); |
1236 | 1236 | $variables['assetFieldSources'] = array_merge( |
1237 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields']], |
|
1237 | + ['entryGroup' => ['optgroup' => $groupName.' Fields']], |
|
1238 | 1238 | FieldHelper::fieldsOfTypeFromSource( |
1239 | 1239 | $sourceBundleType, |
1240 | 1240 | $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__ |