@@ -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, |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | // Output some info if this is a console app |
112 | 112 | if ($job && Craft::$app instanceof ConsoleApplication) { |
113 | - echo $job->description . PHP_EOL; |
|
113 | + echo $job->description.PHP_EOL; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | $lines = []; |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | if ($multiSite) { |
138 | 138 | $urlsetLine .= ' xmlns:xhtml="http://www.w3.org/1999/xhtml"'; |
139 | 139 | } |
140 | - if ((bool)$metaBundle->metaSitemapVars->newsSitemap) { |
|
140 | + if ((bool) $metaBundle->metaSitemapVars->newsSitemap) { |
|
141 | 141 | $urlsetLine .= ' xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"'; |
142 | 142 | } |
143 | 143 | $urlsetLine .= '>'; |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | while ($currentElement < $totalElements) { |
173 | 173 | $elements = $paginator->getPageResults(); |
174 | 174 | if (Craft::$app instanceof ConsoleApplication) { |
175 | - echo 'Query ' . $paginator->getCurrentPage() . '/' . $paginator->getTotalPages() |
|
176 | - . ' - elements: ' . $paginator->getTotalResults() |
|
175 | + echo 'Query '.$paginator->getCurrentPage().'/'.$paginator->getTotalPages() |
|
176 | + . ' - elements: '.$paginator->getTotalResults() |
|
177 | 177 | . PHP_EOL; |
178 | 178 | } |
179 | 179 | /** @var Element $element */ |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | } |
186 | 186 | // Output some info if this is a console app |
187 | 187 | if (Craft::$app instanceof ConsoleApplication) { |
188 | - echo "Processing element {$currentElement}/{$totalElements} - {$element->title}" . PHP_EOL; |
|
188 | + echo "Processing element {$currentElement}/{$totalElements} - {$element->title}".PHP_EOL; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | $metaBundle->metaSitemapVars->setAttributes($stashedSitemapAttrs, false); |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | } |
234 | 234 | $canonicalUrl = UrlHelper::absoluteUrlWithProtocol($canonicalUrl); |
235 | 235 | if ($url !== $canonicalUrl) { |
236 | - Craft::info("Excluding URL: {$url} from the sitemap because it does not match the Canonical URL: {$canonicalUrl} - " . $metaBundle->metaGlobalVars->canonicalUrl . " - " . $element->uri); |
|
236 | + Craft::info("Excluding URL: {$url} from the sitemap because it does not match the Canonical URL: {$canonicalUrl} - ".$metaBundle->metaGlobalVars->canonicalUrl." - ".$element->uri); |
|
237 | 237 | continue; |
238 | 238 | } |
239 | 239 | } |
@@ -294,12 +294,12 @@ discard block |
||
294 | 294 | if ($primarySiteId === $altSourceSiteId && Seomatic::$settings->addXDefaultHrefLang) { |
295 | 295 | $lines[] = '<xhtml:link rel="alternate"' |
296 | 296 | . ' hreflang="x-default"' |
297 | - . ' href="' . Html::encode($altUrl) . '"' |
|
297 | + . ' href="'.Html::encode($altUrl).'"' |
|
298 | 298 | . ' />'; |
299 | 299 | } |
300 | 300 | $lines[] = '<xhtml:link rel="alternate"' |
301 | - . ' hreflang="' . $altSiteSettings['language'] . '"' |
|
302 | - . ' href="' . Html::encode($altUrl) . '"' |
|
301 | + . ' hreflang="'.$altSiteSettings['language'].'"' |
|
302 | + . ' href="'.Html::encode($altUrl).'"' |
|
303 | 303 | . ' />'; |
304 | 304 | } |
305 | 305 | } |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | } |
309 | 309 | } |
310 | 310 | // Handle news sitemaps https://developers.google.com/search/docs/crawling-indexing/sitemaps/news-sitemap |
311 | - if ((bool)$metaBundle->metaSitemapVars->newsSitemap) { |
|
311 | + if ((bool) $metaBundle->metaSitemapVars->newsSitemap) { |
|
312 | 312 | $now = new DateTime(); |
313 | 313 | $interval = $now->diff($dateUpdated); |
314 | 314 | if ($interval->days <= 2) { |
@@ -318,11 +318,11 @@ discard block |
||
318 | 318 | } |
319 | 319 | $lines[] = '<news:news>'; |
320 | 320 | $lines[] = '<news:publication>'; |
321 | - $lines[] = '<news:name>' . $metaBundle->metaSitemapVars->newsPublicationName . '</news:name>'; |
|
322 | - $lines[] = '<news:language>' . $language . '</news:language>'; |
|
321 | + $lines[] = '<news:name>'.$metaBundle->metaSitemapVars->newsPublicationName.'</news:name>'; |
|
322 | + $lines[] = '<news:language>'.$language.'</news:language>'; |
|
323 | 323 | $lines[] = '</news:publication>'; |
324 | - $lines[] = '<news:publication_date>' . $dateUpdated->format(DateTime::W3C) . '</news:publication_date>'; |
|
325 | - $lines[] = '<news:title>' . $element->title . '</news:title>'; |
|
324 | + $lines[] = '<news:publication_date>'.$dateUpdated->format(DateTime::W3C).'</news:publication_date>'; |
|
325 | + $lines[] = '<news:title>'.$element->title.'</news:title>'; |
|
326 | 326 | $lines[] = '</news:news>'; |
327 | 327 | } |
328 | 328 | } |
@@ -420,11 +420,11 @@ discard block |
||
420 | 420 | $lines[] = '</urlset>'; |
421 | 421 | |
422 | 422 | $cache = Craft::$app->getCache(); |
423 | - $cacheKey = SitemapTemplate::CACHE_KEY . $groupId . $type . $handle . $siteId; |
|
423 | + $cacheKey = SitemapTemplate::CACHE_KEY.$groupId.$type.$handle.$siteId; |
|
424 | 424 | $dependency = new TagDependency([ |
425 | 425 | 'tags' => [ |
426 | 426 | SitemapTemplate::GLOBAL_SITEMAP_CACHE_TAG, |
427 | - SitemapTemplate::SITEMAP_CACHE_TAG . $handle . $siteId, |
|
427 | + SitemapTemplate::SITEMAP_CACHE_TAG.$handle.$siteId, |
|
428 | 428 | ], |
429 | 429 | ]); |
430 | 430 | $lines = implode('', $lines); |
@@ -437,10 +437,10 @@ discard block |
||
437 | 437 | $result = $cache->set($cacheKey, $lines, $cacheDuration, $dependency); |
438 | 438 | // Remove the queue job id from the cache too |
439 | 439 | $cache->delete($queueJobCacheKey); |
440 | - Craft::debug('Sitemap cache result: ' . print_r($result, true) . ' for cache key: ' . $cacheKey, __METHOD__); |
|
440 | + Craft::debug('Sitemap cache result: '.print_r($result, true).' for cache key: '.$cacheKey, __METHOD__); |
|
441 | 441 | // Output some info if this is a console app |
442 | 442 | if (Craft::$app instanceof ConsoleApplication) { |
443 | - echo 'Sitemap cache result: ' . print_r($result, true) . ' for cache key: ' . $cacheKey . PHP_EOL; |
|
443 | + echo 'Sitemap cache result: '.print_r($result, true).' for cache key: '.$cacheKey.PHP_EOL; |
|
444 | 444 | } |
445 | 445 | // If the FastCGI Cache Bust plugin is installed, clear its caches too |
446 | 446 | /** @var FastcgiCacheBust $plugin */ |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | */ |
557 | 557 | protected static function assetSitemapItem(Asset $asset, MetaBundle $metaBundle, array &$lines) |
558 | 558 | { |
559 | - if ((bool)$asset->enabledForSite && $asset->getUrl() !== null) { |
|
559 | + if ((bool) $asset->enabledForSite && $asset->getUrl() !== null) { |
|
560 | 560 | switch ($asset->kind) { |
561 | 561 | case 'image': |
562 | 562 | $transform = Craft::$app->getAssetTransforms()->getTransformByHandle($metaBundle->metaSitemapVars->sitemapAssetTransform); |
@@ -569,9 +569,9 @@ discard block |
||
569 | 569 | $fieldName = $row['field'] ?? ''; |
570 | 570 | $propName = $row['property'] ?? ''; |
571 | 571 | if (!empty($fieldName) && !empty($asset[$fieldName]) && !empty($propName)) { |
572 | - $lines[] = '<image:' . $propName . '>'; |
|
572 | + $lines[] = '<image:'.$propName.'>'; |
|
573 | 573 | $lines[] = Html::encode($asset[$fieldName]); |
574 | - $lines[] = '</image:' . $propName . '>'; |
|
574 | + $lines[] = '</image:'.$propName.'>'; |
|
575 | 575 | } |
576 | 576 | } |
577 | 577 | $lines[] = '</image:image>'; |
@@ -587,9 +587,9 @@ discard block |
||
587 | 587 | $fieldName = $row['field'] ?? ''; |
588 | 588 | $propName = $row['property'] ?? ''; |
589 | 589 | if (!empty($fieldName) && !empty($asset[$fieldName]) && !empty($propName)) { |
590 | - $lines[] = '<video:' . $propName . '>'; |
|
590 | + $lines[] = '<video:'.$propName.'>'; |
|
591 | 591 | $lines[] = Html::encode($asset[$fieldName]); |
592 | - $lines[] = '</video:' . $propName . '>'; |
|
592 | + $lines[] = '</video:'.$propName.'>'; |
|
593 | 593 | } |
594 | 594 | } |
595 | 595 | $lines[] = '</video:video>'; |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | */ |
606 | 606 | protected static function assetFilesSitemapLink(Asset $asset, MetaBundle $metaBundle, array &$lines) |
607 | 607 | { |
608 | - if ((bool)$asset->enabledForSite && $asset->getUrl() !== null) { |
|
608 | + if ((bool) $asset->enabledForSite && $asset->getUrl() !== null) { |
|
609 | 609 | if (in_array($asset->kind, SitemapTemplate::FILE_TYPES, false)) { |
610 | 610 | $dateUpdated = $asset->dateUpdated ?? $asset->dateCreated ?? new DateTime(); |
611 | 611 | $lines[] = '<url>'; |