@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | // Constants |
36 | 36 | // ========================================================================= |
37 | 37 | |
38 | - const FRONTENDTEMPLATES_CONTAINER = Seomatic::SEOMATIC_HANDLE . EditableTemplate::TEMPLATE_TYPE; |
|
38 | + const FRONTENDTEMPLATES_CONTAINER = Seomatic::SEOMATIC_HANDLE.EditableTemplate::TEMPLATE_TYPE; |
|
39 | 39 | |
40 | 40 | const HUMANS_TXT_HANDLE = 'humans'; |
41 | 41 | const ROBOTS_TXT_HANDLE = 'robots'; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | Event::on( |
111 | 111 | UrlManager::class, |
112 | 112 | UrlManager::EVENT_REGISTER_SITE_URL_RULES, |
113 | - function (RegisterUrlRulesEvent $event) { |
|
113 | + function(RegisterUrlRulesEvent $event) { |
|
114 | 114 | Craft::debug( |
115 | 115 | 'UrlManager::EVENT_REGISTER_SITE_URL_RULES', |
116 | 116 | __METHOD__ |
@@ -165,16 +165,16 @@ discard block |
||
165 | 165 | $dependency = new TagDependency([ |
166 | 166 | 'tags' => [ |
167 | 167 | self::GLOBAL_FRONTENDTEMPLATE_CACHE_TAG, |
168 | - self::FRONTENDTEMPLATE_CACHE_TAG . $template, |
|
169 | - self::FRONTENDTEMPLATE_CACHE_TAG . $template . $siteId, |
|
168 | + self::FRONTENDTEMPLATE_CACHE_TAG.$template, |
|
169 | + self::FRONTENDTEMPLATE_CACHE_TAG.$template.$siteId, |
|
170 | 170 | ], |
171 | 171 | ]); |
172 | 172 | $cache = Craft::$app->getCache(); |
173 | 173 | $html = $cache->getOrSet( |
174 | - self::CACHE_KEY . $template . $siteId, |
|
175 | - function () use ($template, $params) { |
|
174 | + self::CACHE_KEY.$template.$siteId, |
|
175 | + function() use ($template, $params) { |
|
176 | 176 | Craft::info( |
177 | - 'Frontend template cache miss: ' . $template, |
|
177 | + 'Frontend template cache miss: '.$template, |
|
178 | 178 | __METHOD__ |
179 | 179 | ); |
180 | 180 | $html = ''; |
@@ -245,9 +245,9 @@ discard block |
||
245 | 245 | public function invalidateFrontendTemplateCache(string $template) |
246 | 246 | { |
247 | 247 | $cache = Craft::$app->getCache(); |
248 | - TagDependency::invalidate($cache, self::FRONTENDTEMPLATE_CACHE_TAG . $template); |
|
248 | + TagDependency::invalidate($cache, self::FRONTENDTEMPLATE_CACHE_TAG.$template); |
|
249 | 249 | Craft::info( |
250 | - 'Frontend template cache cleared: ' . $template, |
|
250 | + 'Frontend template cache cleared: '.$template, |
|
251 | 251 | __METHOD__ |
252 | 252 | ); |
253 | 253 | } |
@@ -66,7 +66,7 @@ |
||
66 | 66 | array $params = [], |
67 | 67 | string $minifier = null |
68 | 68 | ): string { |
69 | - $template = 'seomatic/' . $templatePath; |
|
69 | + $template = 'seomatic/'.$templatePath; |
|
70 | 70 | $oldMode = Craft::$app->view->getTemplateMode(); |
71 | 71 | // Look for the template on the frontend first |
72 | 72 | try { |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | $suffix = ''; |
156 | 156 | } |
157 | 157 | // Remove potential double spaces |
158 | - $prefix = preg_replace('/\s+/', ' ', $prefix);; |
|
159 | - $suffix = preg_replace('/\s+/', ' ', $suffix);; |
|
158 | + $prefix = preg_replace('/\s+/', ' ', $prefix); ; |
|
159 | + $suffix = preg_replace('/\s+/', ' ', $suffix); ; |
|
160 | 160 | $lengthAdjust = mb_strlen($prefix.$suffix); |
161 | 161 | // Parse the data |
162 | 162 | $scenario = $this->scenario; |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $data = trim($data); |
186 | 186 | // devMode |
187 | 187 | if (Seomatic::$devMode) { |
188 | - $data = Seomatic::$settings->devModeTitlePrefix . $data; |
|
188 | + $data = Seomatic::$settings->devModeTitlePrefix.$data; |
|
189 | 189 | } |
190 | 190 | } |
191 | 191 |
@@ -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'; |
@@ -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; |