Test Failed
Push — develop-v4 ( b712aa...bd527c )
by Andrew
28:50 queued 20:13
created
src/controllers/ContentSeoController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     /**
47 47
      * @var    bool|array
48 48
      */
49
-    protected array|bool|int $allowAnonymous = [
49
+    protected array | bool | int $allowAnonymous = [
50 50
     ];
51 51
 
52 52
     // Public Methods
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         // Query the db table
101 101
         $offset = ($page - 1) * $per_page;
102 102
         $currentSiteHandle = '';
103
-        if ((int)$siteId !== 0) {
103
+        if ((int) $siteId !== 0) {
104 104
             $site = Craft::$app->getSites()->getSiteById($siteId);
105 105
             if ($site !== null) {
106 106
                 $currentSiteHandle = $site->handle;
@@ -155,11 +155,11 @@  discard block
 block discarded – undo
155 155
                     $numGrades = \count(SettingsController::SETUP_GRADES);
156 156
                     $numFields = \count(SettingsController::SEO_SETUP_FIELDS);
157 157
                     foreach (SettingsController::SEO_SETUP_FIELDS as $setupField => $setupLabel) {
158
-                        $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]);
158
+                        $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]);
159 159
                         $value = $variables['contentSetupChecklist'][$setupField]['value'] ?? 0;
160 160
                         $variables['contentSetupChecklist'][$setupField] = [
161 161
                             'label' => $setupLabel,
162
-                            'value' => $value + (int)!empty($metaBundle->metaGlobalVars[$setupField]),
162
+                            'value' => $value + (int) !empty($metaBundle->metaGlobalVars[$setupField]),
163 163
                         ];
164 164
                     }
165 165
                     $stat = round($numGrades - (($stat * $numGrades) / $numFields));
Please login to merge, or discard this patch.
src/controllers/JsonLdController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     /**
31 31
      * @inheritdoc
32 32
      */
33
-    protected array|bool|int $allowAnonymous = [
33
+    protected array | bool | int $allowAnonymous = [
34 34
         'get-type',
35 35
         'get-decomposed-type',
36 36
         'get-type-array',
Please login to merge, or discard this patch.
src/controllers/PreviewController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     /**
33 33
      * @inheritdoc
34 34
      */
35
-    protected array|bool|int $allowAnonymous = [
35
+    protected array | bool | int $allowAnonymous = [
36 36
         'social-media',
37 37
     ];
38 38
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         $html = '';
54 54
 
55 55
         // Don't allow the preview to be accessed publicly
56
-        $this->requireAuthorization(Seomatic::SEOMATIC_PREVIEW_AUTHORIZATION_KEY . $elementId);
56
+        $this->requireAuthorization(Seomatic::SEOMATIC_PREVIEW_AUTHORIZATION_KEY.$elementId);
57 57
 
58 58
         /** @var Element $element */
59 59
         $element = Craft::$app->getElements()->getElementById($elementId, null, $siteId);
Please login to merge, or discard this patch.
src/controllers/SettingsController.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     /**
88 88
      * @inheritdoc
89 89
      */
90
-    protected array|bool|int $allowAnonymous = [
90
+    protected array | bool | int $allowAnonymous = [
91 91
     ];
92 92
 
93 93
     // Public Methods
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         $variables['pluginName'] = Seomatic::$settings->pluginName;
131 131
         $variables['title'] = $templateTitle;
132 132
         $variables['docTitle'] = "{$pluginName} - {$templateTitle}";
133
-        $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : '';
133
+        $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : '';
134 134
         $variables['crumbs'] = [
135 135
             [
136 136
                 'label' => $pluginName,
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
             ],
139 139
             [
140 140
                 'label' => $templateTitle,
141
-                'url' => UrlHelper::cpUrl('seomatic/dashboard' . $siteHandleUri),
141
+                'url' => UrlHelper::cpUrl('seomatic/dashboard'.$siteHandleUri),
142 142
             ],
143 143
         ];
144 144
         $variables['selectedSubnavItem'] = 'dashboard';
@@ -161,11 +161,11 @@  discard block
 block discarded – undo
161 161
         foreach ($variables['metaBundles'] as $metaBundle) {
162 162
             $stat = 0;
163 163
             foreach (self::SEO_SETUP_FIELDS as $setupField => $setupLabel) {
164
-                $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]);
164
+                $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]);
165 165
                 $value = $variables['contentSetupChecklist'][$setupField]['value'] ?? 0;
166 166
                 $variables['contentSetupChecklist'][$setupField] = [
167 167
                     'label' => $setupLabel,
168
-                    'value' => $value + (int)!empty($metaBundle->metaGlobalVars[$setupField]),
168
+                    'value' => $value + (int) !empty($metaBundle->metaGlobalVars[$setupField]),
169 169
                 ];
170 170
             }
171 171
             $stat = round($numGrades - (($stat * $numGrades) / $numFields));
@@ -176,16 +176,16 @@  discard block
 block discarded – undo
176 176
         }
177 177
         // Global SEO grades
178 178
         Seomatic::$previewingMetaContainers = true;
179
-        $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int)$siteId);
179
+        $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int) $siteId);
180 180
         Seomatic::$previewingMetaContainers = false;
181 181
         if ($metaBundle !== null) {
182 182
             $stat = 0;
183 183
             $variables['globalSetupChecklist'] = [];
184 184
             foreach (self::SEO_SETUP_FIELDS as $setupField => $setupLabel) {
185
-                $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]);
185
+                $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]);
186 186
                 $variables['globalSetupChecklist'][$setupField] = [
187 187
                     'label' => $setupLabel,
188
-                    'value' => (int)!empty($metaBundle->metaGlobalVars[$setupField]),
188
+                    'value' => (int) !empty($metaBundle->metaGlobalVars[$setupField]),
189 189
                 ];
190 190
             }
191 191
             $stat = round(($stat / $numFields) * 100);
@@ -195,17 +195,17 @@  discard block
 block discarded – undo
195 195
             $stat = 0;
196 196
             $variables['siteSetupChecklist'] = [];
197 197
             foreach (self::SITE_SETUP_FIELDS as $setupField => $setupLabel) {
198
-                $stat += (int)!empty($metaBundle->metaSiteVars[$setupField]);
198
+                $stat += (int) !empty($metaBundle->metaSiteVars[$setupField]);
199 199
                 $variables['siteSetupChecklist'][$setupField] = [
200 200
                     'label' => $setupLabel,
201
-                    'value' => (int)!empty($metaBundle->metaSiteVars[$setupField]),
201
+                    'value' => (int) !empty($metaBundle->metaSiteVars[$setupField]),
202 202
                 ];
203 203
             }
204 204
             foreach (self::IDENTITY_SETUP_FIELDS as $setupField => $setupLabel) {
205
-                $stat += (int)!empty($metaBundle->metaSiteVars->identity[$setupField]);
205
+                $stat += (int) !empty($metaBundle->metaSiteVars->identity[$setupField]);
206 206
                 $variables['siteSetupChecklist'][$setupField] = [
207 207
                     'label' => $setupLabel,
208
-                    'value' => (int)!empty($metaBundle->metaSiteVars->identity[$setupField]),
208
+                    'value' => (int) !empty($metaBundle->metaSiteVars->identity[$setupField]),
209 209
                 ];
210 210
             }
211 211
             $stat = round(($stat / $numFields) * 100);
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
         $variables['title'] = $templateTitle;
253 253
         $variables['subSectionTitle'] = $subSectionTitle;
254 254
         $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}";
255
-        $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : '';
255
+        $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : '';
256 256
         $variables['crumbs'] = [
257 257
             [
258 258
                 'label' => $pluginName,
@@ -260,11 +260,11 @@  discard block
 block discarded – undo
260 260
             ],
261 261
             [
262 262
                 'label' => $templateTitle,
263
-                'url' => UrlHelper::cpUrl('seomatic/global/general' . $siteHandleUri),
263
+                'url' => UrlHelper::cpUrl('seomatic/global/general'.$siteHandleUri),
264 264
             ],
265 265
             [
266 266
                 'label' => $subSectionTitle,
267
-                'url' => UrlHelper::cpUrl('seomatic/global/' . $subSection . $siteHandleUri),
267
+                'url' => UrlHelper::cpUrl('seomatic/global/'.$subSection.$siteHandleUri),
268 268
             ],
269 269
         ];
270 270
         $variables['selectedSubnavItem'] = 'global';
@@ -272,14 +272,14 @@  discard block
 block discarded – undo
272 272
         $this->setGlobalFieldSourceVariables($variables);
273 273
         // Enabled sites
274 274
         $this->setMultiSiteVariables($siteHandle, $siteId, $variables);
275
-        $variables['controllerHandle'] = 'global' . '/' . $subSection;
275
+        $variables['controllerHandle'] = 'global'.'/'.$subSection;
276 276
         $variables['currentSubSection'] = $subSection;
277 277
         // Meta bundle settings
278 278
         Seomatic::$previewingMetaContainers = true;
279 279
         // Get the site to copy the settings from, if any
280 280
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
281 281
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
282
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
282
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
283 283
         // Load the metabundle
284 284
         $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad);
285 285
         if ($editedMetaBundle) {
@@ -333,11 +333,11 @@  discard block
 block discarded – undo
333 333
         // Preview the meta containers
334 334
         Seomatic::$plugin->metaContainers->previewMetaContainers(
335 335
             MetaBundles::GLOBAL_META_BUNDLE,
336
-            (int)$variables['currentSiteId']
336
+            (int) $variables['currentSiteId']
337 337
         );
338 338
 
339 339
         // Render the template
340
-        return $this->renderTemplate('seomatic/settings/global/' . $subSection, $variables);
340
+        return $this->renderTemplate('seomatic/settings/global/'.$subSection, $variables);
341 341
     }
342 342
 
343 343
     /**
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
         $variables['pluginName'] = Seomatic::$settings->pluginName;
462 462
         $variables['title'] = $templateTitle;
463 463
         $variables['docTitle'] = "{$pluginName} - {$templateTitle}";
464
-        $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : '';
464
+        $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : '';
465 465
         $variables['crumbs'] = [
466 466
             [
467 467
                 'label' => $pluginName,
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
             ],
470 470
             [
471 471
                 'label' => $templateTitle,
472
-                'url' => UrlHelper::cpUrl('seomatic/content' . $siteHandleUri),
472
+                'url' => UrlHelper::cpUrl('seomatic/content'.$siteHandleUri),
473 473
             ],
474 474
         ];
475 475
         $this->setMultiSiteVariables($siteHandle, $siteId, $variables);
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
         // Get the site to edit
511 511
         $siteId = $this->getSiteIdFromHandle($siteHandle);
512 512
         if ($typeId !== null && is_string($typeId)) {
513
-            $typeId = (int)$typeId;
513
+            $typeId = (int) $typeId;
514 514
         }
515 515
         // Get the (entry) type menu
516 516
         $typeMenu = [];
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
             $currentType = reset($typeMenu);
525 525
             $variables['currentType'] = $typeMenu[$typeId] ?? $currentType;
526 526
             $variables['currentTypeId'] = $typeId ?? key($typeMenu);
527
-            $typeId = (int)$variables['currentTypeId'];
527
+            $typeId = (int) $variables['currentTypeId'];
528 528
         }
529 529
         $pluginName = Seomatic::$settings->pluginName;
530 530
         // Asset bundle
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
         // Get the site to copy the settings from, if any
546 546
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
547 547
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
548
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
548
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
549 549
         // Load the metabundle
550 550
         $metaBundle = Seomatic::$plugin->metaBundles->getMetaBundleBySourceHandle(
551 551
             $sourceBundleType,
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
         $variables['title'] = $templateTitle;
572 572
         $variables['subSectionTitle'] = $subSectionTitle;
573 573
         $variables['docTitle'] = "{$pluginName} - Content SEO - {$templateTitle} - {$subSectionTitle}";
574
-        $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : '';
574
+        $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : '';
575 575
         $variables['siteHandleUri'] = $siteHandleUri;
576 576
         $variables['crumbs'] = [
577 577
             [
@@ -580,10 +580,10 @@  discard block
 block discarded – undo
580 580
             ],
581 581
             [
582 582
                 'label' => 'Content SEO',
583
-                'url' => UrlHelper::cpUrl('seomatic/content' . $siteHandleUri),
583
+                'url' => UrlHelper::cpUrl('seomatic/content'.$siteHandleUri),
584 584
             ],
585 585
             [
586
-                'label' => $metaBundle->sourceName . ' · ' . $subSectionTitle,
586
+                'label' => $metaBundle->sourceName.' · '.$subSectionTitle,
587 587
                 'url' => UrlHelper::cpUrl("seomatic/edit-content/${subSection}/${sourceBundleType}/${sourceHandle}"),
588 588
             ],
589 589
         ];
@@ -613,13 +613,13 @@  discard block
 block discarded – undo
613 613
         // Preview the meta containers
614 614
         Seomatic::$plugin->metaContainers->previewMetaContainers(
615 615
             $uri,
616
-            (int)$variables['currentSiteId'],
616
+            (int) $variables['currentSiteId'],
617 617
             false,
618 618
             false
619 619
         );
620 620
 
621 621
         // Render the template
622
-        return $this->renderTemplate('seomatic/settings/content/' . $subSection, $variables);
622
+        return $this->renderTemplate('seomatic/settings/content/'.$subSection, $variables);
623 623
     }
624 624
 
625 625
     /**
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
         if ($subSection === 'social') {
702 702
             $subSectionSuffix = ' Media';
703 703
         }
704
-        $subSectionTitle = Craft::t('seomatic', ucfirst($subSection) . $subSectionSuffix);
704
+        $subSectionTitle = Craft::t('seomatic', ucfirst($subSection).$subSectionSuffix);
705 705
         // Asset bundle
706 706
         try {
707 707
             Seomatic::$view->registerAssetBundle(SeomaticAsset::class);
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
         $variables['title'] = $templateTitle;
720 720
         $variables['subSectionTitle'] = $subSectionTitle;
721 721
         $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}";
722
-        $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : '';
722
+        $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : '';
723 723
         $variables['crumbs'] = [
724 724
             [
725 725
                 'label' => $pluginName,
@@ -727,11 +727,11 @@  discard block
 block discarded – undo
727 727
             ],
728 728
             [
729 729
                 'label' => $templateTitle,
730
-                'url' => UrlHelper::cpUrl('seomatic/site/identity' . $siteHandleUri),
730
+                'url' => UrlHelper::cpUrl('seomatic/site/identity'.$siteHandleUri),
731 731
             ],
732 732
             [
733 733
                 'label' => $subSectionTitle,
734
-                'url' => UrlHelper::cpUrl('seomatic/site/' . $subSection . $siteHandleUri),
734
+                'url' => UrlHelper::cpUrl('seomatic/site/'.$subSection.$siteHandleUri),
735 735
             ],
736 736
         ];
737 737
         $variables['selectedSubnavItem'] = 'site';
@@ -739,14 +739,14 @@  discard block
 block discarded – undo
739 739
 
740 740
         // Enabled sites
741 741
         $this->setMultiSiteVariables($siteHandle, $siteId, $variables);
742
-        $variables['controllerHandle'] = 'site' . '/' . $subSection;
742
+        $variables['controllerHandle'] = 'site'.'/'.$subSection;
743 743
 
744 744
         // The site settings for the appropriate meta bundle
745 745
         Seomatic::$previewingMetaContainers = true;
746 746
         // Get the site to copy the settings from, if any
747 747
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
748 748
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
749
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
749
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
750 750
         // Load the metabundle
751 751
         $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad);
752 752
         Seomatic::$previewingMetaContainers = false;
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
         $variables['elementType'] = Asset::class;
765 765
 
766 766
         // Render the template
767
-        return $this->renderTemplate('seomatic/settings/site/' . $subSection, $variables);
767
+        return $this->renderTemplate('seomatic/settings/site/'.$subSection, $variables);
768 768
     }
769 769
 
770 770
     /**
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
         $siteId = $this->getSiteIdFromHandle($siteHandle);
894 894
         // Enabled sites
895 895
         $this->setMultiSiteVariables($siteHandle, $siteId, $variables);
896
-        $variables['controllerHandle'] = 'tracking' . '/' . $subSection;
896
+        $variables['controllerHandle'] = 'tracking'.'/'.$subSection;
897 897
         $variables['currentSubSection'] = $subSection;
898 898
 
899 899
         // The script meta containers for the global meta bundle
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
         // Get the site to copy the settings from, if any
902 902
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
903 903
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
904
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
904
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
905 905
         // Load the metabundle
906 906
         $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad);
907 907
         if ($editedMetaBundle) {
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
         $variables['title'] = $templateTitle;
942 942
         $variables['subSectionTitle'] = $subSectionTitle;
943 943
         $variables['docTitle'] = "{$pluginName} - {$templateTitle} - {$subSectionTitle}";
944
-        $siteHandleUri = Craft::$app->isMultiSite ? '/' . $siteHandle : '';
944
+        $siteHandleUri = Craft::$app->isMultiSite ? '/'.$siteHandle : '';
945 945
         $variables['crumbs'] = [
946 946
             [
947 947
                 'label' => $pluginName,
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
             ],
954 954
             [
955 955
                 'label' => $subSectionTitle,
956
-                'url' => UrlHelper::cpUrl('seomatic/tracking/' . $subSection . $siteHandleUri),
956
+                'url' => UrlHelper::cpUrl('seomatic/tracking/'.$subSection.$siteHandleUri),
957 957
             ],
958 958
         ];
959 959
         $variables['selectedSubnavItem'] = 'tracking';
@@ -1086,7 +1086,7 @@  discard block
 block discarded – undo
1086 1086
         if ($siteHandle !== null) {
1087 1087
             $site = Craft::$app->getSites()->getSiteByHandle($siteHandle);
1088 1088
             if (!$site) {
1089
-                throw new NotFoundHttpException('Invalid site handle: ' . $siteHandle);
1089
+                throw new NotFoundHttpException('Invalid site handle: '.$siteHandle);
1090 1090
             }
1091 1091
             $siteId = $site->id;
1092 1092
         } else {
@@ -1123,7 +1123,7 @@  discard block
 block discarded – undo
1123 1123
                 if (!empty($variables['enabledSiteIds'])) {
1124 1124
                     $siteId = reset($variables['enabledSiteIds']);
1125 1125
                 } else {
1126
-                    $this->requirePermission('editSite:' . $siteId);
1126
+                    $this->requirePermission('editSite:'.$siteId);
1127 1127
                 }
1128 1128
             }
1129 1129
         }
@@ -1143,7 +1143,7 @@  discard block
 block discarded – undo
1143 1143
         if ($variables['showSites']) {
1144 1144
             $variables['sitesMenuLabel'] = Craft::t(
1145 1145
                 'site',
1146
-                $sites->getSiteById((int)$variables['currentSiteId'])->name
1146
+                $sites->getSiteById((int) $variables['currentSiteId'])->name
1147 1147
             );
1148 1148
         } else {
1149 1149
             $variables['sitesMenuLabel'] = '';
@@ -1209,7 +1209,7 @@  discard block
 block discarded – undo
1209 1209
     )
1210 1210
     {
1211 1211
         $variables['textFieldSources'] = array_merge(
1212
-            ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'],
1212
+            ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'],
1213 1213
             FieldHelper::fieldsOfTypeFromSource(
1214 1214
                 $sourceBundleType,
1215 1215
                 $sourceHandle,
@@ -1218,7 +1218,7 @@  discard block
 block discarded – undo
1218 1218
             )
1219 1219
         );
1220 1220
         $variables['assetFieldSources'] = array_merge(
1221
-            ['entryGroup' => ['optgroup' => $groupName . ' Fields']],
1221
+            ['entryGroup' => ['optgroup' => $groupName.' Fields']],
1222 1222
             FieldHelper::fieldsOfTypeFromSource(
1223 1223
                 $sourceBundleType,
1224 1224
                 $sourceHandle,
Please login to merge, or discard this patch.
src/controllers/FileController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     /**
35 35
      * @inheritdoc
36 36
      */
37
-    protected array|bool|int $allowAnonymous = [
37
+    protected array | bool | int $allowAnonymous = [
38 38
         'seo-file-link',
39 39
     ];
40 40
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             }
84 84
             // Add the Link header
85 85
             if (!empty($canonical)) {
86
-                $headerValue = '<' . $canonical . '>; rel="canonical"';
86
+                $headerValue = '<'.$canonical.'>; rel="canonical"';
87 87
                 $response->headers->add('Link', $headerValue);
88 88
             }
89 89
             // Ensure the file type is allowed
Please login to merge, or discard this patch.
src/services/MetaBundles.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
      * @param MetaBundle $metaBundle
179 179
      * @param bool $forceUpdate
180 180
      */
181
-    public function syncBundleWithConfig(MetaBundle &$metaBundle, bool $forceUpdate = false)
181
+    public function syncBundleWithConfig(MetaBundle & $metaBundle, bool $forceUpdate = false)
182 182
     {
183 183
         $prevMetaBundle = $metaBundle;
184 184
         $config = [];
@@ -259,8 +259,8 @@  discard block
 block discarded – undo
259 259
      */
260 260
     public function updateMetaBundle(MetaBundle $metaBundle, int $siteId)
261 261
     {
262
-        $metaBundle->sourceName = (string)$metaBundle->sourceName;
263
-        $metaBundle->sourceTemplate = (string)$metaBundle->sourceTemplate;
262
+        $metaBundle->sourceName = (string) $metaBundle->sourceName;
263
+        $metaBundle->sourceTemplate = (string) $metaBundle->sourceTemplate;
264 264
         // Make sure it validates
265 265
         if ($metaBundle->validate(null, true)) {
266 266
             // Save it out to a record
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
                 'sourceSiteId' => $siteId,
271 271
             ];
272 272
             if ($metaBundle->typeId !== null) {
273
-                $metaBundle->typeId = (int)$metaBundle->typeId;
273
+                $metaBundle->typeId = (int) $metaBundle->typeId;
274 274
             }
275 275
             if (!empty($metaBundle->typeId)) {
276 276
                 $params['typeId'] = $metaBundle->typeId;
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
             // @TODO remove this hack that doesn't allow environment-transformed settings to be saved in a meta bundle with a proper system to address it
287 287
             // The issue was that the containers were getting saved to the db with a hard-coded setting in them, because they'd
288 288
             // been set that way by the environment, whereas to be changeable via the GUI, it needs to be set to {seomatic.meta.robots}
289
-            $robotsTag = $metaBundle->metaContainers[MetaTagContainer::CONTAINER_TYPE . TagService::GENERAL_HANDLE]->data['robots'] ?? null;
289
+            $robotsTag = $metaBundle->metaContainers[MetaTagContainer::CONTAINER_TYPE.TagService::GENERAL_HANDLE]->data['robots'] ?? null;
290 290
             if (!empty($robotsTag)) {
291 291
                 $robotsTag->content = $robotsTag->environment['live']['content'] ?? '{{ seomatic.meta.robots }}';
292 292
             }
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
                 $metaBundleDefaults = ArrayHelper::merge(
369 369
                     $seoElement::metaBundleConfig($sourceModel),
370 370
                     [
371
-                        'sourceTemplate' => (string)$siteSetting->template,
371
+                        'sourceTemplate' => (string) $siteSetting->template,
372 372
                         'sourceSiteId' => $siteSetting->siteId,
373 373
                         'sourceAltSiteSettings' => $siteSettingsArray,
374 374
                         'sourceDateUpdated' => $dateUpdated,
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
     public function getMetaBundleBySourceHandle(string $sourceBundleType, string $sourceHandle, int $sourceSiteId, $typeId = null)
417 417
     {
418 418
         $metaBundle = null;
419
-        $typeId = (int)$typeId;
419
+        $typeId = (int) $typeId;
420 420
         // See if we have the meta bundle cached
421 421
         if (!empty($this->metaBundlesBySourceHandle[$sourceBundleType][$sourceHandle][$sourceSiteId][$typeId])) {
422 422
             $id = $this->metaBundlesBySourceHandle[$sourceBundleType][$sourceHandle][$sourceSiteId][$typeId];
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
                             /** @var Section|CategoryGroup|ProductType $sourceModel */
504 504
                             $sourceModel = $seoElement::sourceModelFromId($sourceId);
505 505
                             if ($sourceModel !== null) {
506
-                                $metaBundle->sourceName = (string)$sourceModel->name;
506
+                                $metaBundle->sourceName = (string) $sourceModel->name;
507 507
                                 $metaBundle->sourceHandle = $sourceModel->handle;
508 508
                             }
509 509
                         }
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
     public function getMetaBundleBySourceId(string $sourceBundleType, int $sourceId, int $sourceSiteId, $typeId = null)
545 545
     {
546 546
         $metaBundle = null;
547
-        $typeId = (int)$typeId;
547
+        $typeId = (int) $typeId;
548 548
         // See if we have the meta bundle cached
549 549
         if (!empty($this->metaBundlesBySourceId[$sourceBundleType][$sourceId][$sourceSiteId][$typeId])) {
550 550
             $id = $this->metaBundlesBySourceId[$sourceBundleType][$sourceId][$sourceSiteId][$typeId];
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
                 ->from(['{{%seomatic_metabundles}}'])
740 740
                 ->where(['=', 'sourceBundleType', $seoElement::META_BUNDLE_TYPE]);
741 741
 
742
-            if ((int)$sourceSiteId !== 0) {
742
+            if ((int) $sourceSiteId !== 0) {
743 743
                 $subQuery->andWhere(['sourceSiteId' => $sourceSiteId]);
744 744
             }
745 745
             if ($filter !== '') {
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
     public function getContentMetaBundleForElement(Element $element)
777 777
     {
778 778
         $source = $this->getMetaSourceFromElement($element);
779
-        $key = implode(".", $source) . '.' . $element->siteId;
779
+        $key = implode(".", $source).'.'.$element->siteId;
780 780
 
781 781
         if (empty($this->elementContentMetaBundles[$key])) {
782 782
             $this->elementContentMetaBundles[$key] = $this->getMetaBundleBySourceId($source[1], $source[0], $element->siteId, $source[4]);
Please login to merge, or discard this patch.
src/services/MetaContainers.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         // Get the page number of this request
161 161
         $request = Craft::$app->getRequest();
162 162
         if (!$request->isConsoleRequest) {
163
-            $this->paginationPage = (string)$request->pageNum;
163
+            $this->paginationPage = (string) $request->pageNum;
164 164
         }
165 165
     }
166 166
 
@@ -176,10 +176,10 @@  discard block
 block discarded – undo
176 176
         $uniqueKey = $dependency->tags[3] ?? self::GLOBALS_CACHE_KEY;
177 177
         $uniqueKey .= $bodyPosition;
178 178
         $scriptData = Craft::$app->getCache()->getOrSet(
179
-            self::GLOBALS_CACHE_KEY . $uniqueKey,
180
-            function () use ($uniqueKey, $bodyPosition) {
179
+            self::GLOBALS_CACHE_KEY.$uniqueKey,
180
+            function() use ($uniqueKey, $bodyPosition) {
181 181
                 Craft::info(
182
-                    self::SCRIPTS_CACHE_KEY . ' cache miss: ' . $uniqueKey,
182
+                    self::SCRIPTS_CACHE_KEY.' cache miss: '.$uniqueKey,
183 183
                     __METHOD__
184 184
                 );
185 185
                 $scriptData = [];
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
                             foreach ($scriptContainer->data as $metaScript) {
192 192
                                 /** @var MetaScript $metaScript */
193 193
                                 if (!empty($metaScript->bodyTemplatePath)
194
-                                    && ((int)$metaScript->bodyPosition === $bodyPosition)) {
194
+                                    && ((int) $metaScript->bodyPosition === $bodyPosition)) {
195 195
                                     $scriptData[] = $metaScript->renderBodyHtml();
196 196
                                 }
197 197
                             }
@@ -271,10 +271,10 @@  discard block
 block discarded – undo
271 271
         $dependency = $this->containerDependency;
272 272
         $uniqueKey = $dependency->tags[3] ?? self::GLOBALS_CACHE_KEY;
273 273
         list($this->metaGlobalVars, $this->metaSiteVars) = Craft::$app->getCache()->getOrSet(
274
-            self::GLOBALS_CACHE_KEY . $uniqueKey,
275
-            function () use ($uniqueKey) {
274
+            self::GLOBALS_CACHE_KEY.$uniqueKey,
275
+            function() use ($uniqueKey) {
276 276
                 Craft::info(
277
-                    self::GLOBALS_CACHE_KEY . ' cache miss: ' . $uniqueKey,
277
+                    self::GLOBALS_CACHE_KEY.' cache miss: '.$uniqueKey,
278 278
                     __METHOD__
279 279
                 );
280 280
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
                     ?? 1;
396 396
             }
397 397
             // Handle pagination
398
-            $paginationPage = 'page' . $this->paginationPage;
398
+            $paginationPage = 'page'.$this->paginationPage;
399 399
             // Get the path for the current request
400 400
             $request = Craft::$app->getRequest();
401 401
             $requestPath = '/';
@@ -411,21 +411,21 @@  discard block
 block discarded – undo
411 411
                 }
412 412
             }
413 413
             // Get our cache key
414
-            $cacheKey = $uri . $siteId . $paginationPage . $requestPath . $this->getAllowedUrlParams();
414
+            $cacheKey = $uri.$siteId.$paginationPage.$requestPath.$this->getAllowedUrlParams();
415 415
             // For requests with a status code of >= 400, use one cache key
416 416
             if (!$request->isConsoleRequest) {
417 417
                 $response = Craft::$app->getResponse();
418 418
                 if ($response->statusCode >= 400) {
419
-                    $cacheKey = $siteId . self::INVALID_RESPONSE_CACHE_KEY . $response->statusCode;
419
+                    $cacheKey = $siteId.self::INVALID_RESPONSE_CACHE_KEY.$response->statusCode;
420 420
                 }
421 421
             }
422 422
             // Load the meta containers
423 423
             $dependency = new TagDependency([
424 424
                 'tags' => [
425 425
                     self::GLOBAL_METACONTAINER_CACHE_TAG,
426
-                    self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId,
427
-                    self::METACONTAINER_CACHE_TAG . $uri . $siteId,
428
-                    self::METACONTAINER_CACHE_TAG . $cacheKey,
426
+                    self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId,
427
+                    self::METACONTAINER_CACHE_TAG.$uri.$siteId,
428
+                    self::METACONTAINER_CACHE_TAG.$cacheKey,
429 429
                 ],
430 430
             ]);
431 431
             $this->containerDependency = $dependency;
@@ -441,10 +441,10 @@  discard block
 block discarded – undo
441 441
             } else {
442 442
                 $cache = Craft::$app->getCache();
443 443
                 list($this->metaGlobalVars, $this->metaSiteVars, $this->metaSitemapVars, $this->metaContainers) = $cache->getOrSet(
444
-                    self::CACHE_KEY . $cacheKey,
445
-                    function () use ($uri, $siteId) {
444
+                    self::CACHE_KEY.$cacheKey,
445
+                    function() use ($uri, $siteId) {
446 446
                         Craft::info(
447
-                            'Meta container cache miss: ' . $uri . '/' . $siteId,
447
+                            'Meta container cache miss: '.$uri.'/'.$siteId,
448 448
                             __METHOD__
449 449
                         );
450 450
                         $this->loadGlobalMetaContainers($siteId);
@@ -839,10 +839,10 @@  discard block
 block discarded – undo
839 839
         $cache = Craft::$app->getCache();
840 840
         TagDependency::invalidate(
841 841
             $cache,
842
-            self::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId
842
+            self::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId
843 843
         );
844 844
         Craft::info(
845
-            'Meta bundle cache cleared: ' . $metaBundleSourceId . ' / ' . $metaBundleSourceType . ' / ' . $siteId,
845
+            'Meta bundle cache cleared: '.$metaBundleSourceId.' / '.$metaBundleSourceType.' / '.$siteId,
846 846
             __METHOD__
847 847
         );
848 848
         // Trigger an event to let other plugins/modules know we've cleared our caches
@@ -869,9 +869,9 @@  discard block
 block discarded – undo
869 869
         if ($siteId === null) {
870 870
             $siteId = Craft::$app->getSites()->currentSite->id ?? 1;
871 871
         }
872
-        TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG . $uri . $siteId);
872
+        TagDependency::invalidate($cache, self::METACONTAINER_CACHE_TAG.$uri.$siteId);
873 873
         Craft::info(
874
-            'Meta container cache cleared: ' . $uri . ' / ' . $siteId,
874
+            'Meta container cache cleared: '.$uri.' / '.$siteId,
875 875
             __METHOD__
876 876
         );
877 877
         // Trigger an event to let other plugins/modules know we've cleared our caches
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
 
989 989
                     // Handle re-creating the `mainEntityOfPage` so that the model injected into the
990 990
                     // templates has the appropriate attributes
991
-                    $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE . JsonLdService::GENERAL_HANDLE;
991
+                    $generalContainerKey = MetaJsonLdContainer::CONTAINER_TYPE.JsonLdService::GENERAL_HANDLE;
992 992
                     $generalContainer = $this->metaContainers[$generalContainerKey];
993 993
                     if (($generalContainer !== null) && !empty($generalContainer->data['mainEntityOfPage'])) {
994 994
                         /** @var MetaJsonLd $jsonLdModel */
Please login to merge, or discard this patch.
src/seoelements/SeoDigitalProduct.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         Event::on(
106 106
             ProductTypes::class,
107 107
             ProductTypes::EVENT_AFTER_SAVE_PRODUCTTYPE,
108
-            function (ProductTypeEvent $event) {
108
+            function(ProductTypeEvent $event) {
109 109
                 Craft::debug(
110 110
                     'ProductTypes::EVENT_AFTER_SAVE_PRODUCTTYPE',
111 111
                     __METHOD__
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                 ProductTypes::class,
122 122
                 ProductTypes::EVENT_AFTER_SAVE_PRODUCTTYPE,
123 123
                 /** @var ProductTypeEvent $event */
124
-                static function ($event) {
124
+                static function($event) {
125 125
                     Craft::debug(
126 126
                         'ProductTypes::EVENT_AFTER_SAVE_PRODUCTTYPE',
127 127
                         __METHOD__
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         Event::on(
178 178
             Product::class,
179 179
             Product::EVENT_DEFINE_SIDEBAR_HTML,
180
-            static function (DefineHtmlEvent $event) {
180
+            static function(DefineHtmlEvent $event) {
181 181
                 Craft::debug(
182 182
                     'Product::EVENT_DEFINE_SIDEBAR_HTML',
183 183
                     __METHOD__
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
             ConfigHelper::getConfigFromFile(self::configFilePath()),
387 387
             [
388 388
                 'sourceId' => $sourceModel->id,
389
-                'sourceName' => (string)$sourceModel->name,
389
+                'sourceName' => (string) $sourceModel->name,
390 390
                 'sourceHandle' => $sourceModel->handle,
391 391
             ]
392 392
         );
Please login to merge, or discard this patch.
src/seoelements/SeoEntry.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         Event::on(
109 109
             Sections::class,
110 110
             Sections::EVENT_AFTER_SAVE_SECTION,
111
-            function (SectionEvent $event) {
111
+            function(SectionEvent $event) {
112 112
                 Craft::debug(
113 113
                     'Sections::EVENT_AFTER_SAVE_SECTION',
114 114
                     __METHOD__
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         Event::on(
120 120
             Sections::class,
121 121
             Sections::EVENT_AFTER_DELETE_SECTION,
122
-            function (SectionEvent $event) {
122
+            function(SectionEvent $event) {
123 123
                 Craft::debug(
124 124
                     'Sections::EVENT_AFTER_DELETE_SECTION',
125 125
                     __METHOD__
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             Event::on(
135 135
                 Sections::class,
136 136
                 Sections::EVENT_AFTER_SAVE_SECTION,
137
-                function (SectionEvent $event) {
137
+                function(SectionEvent $event) {
138 138
                     Craft::debug(
139 139
                         'Sections::EVENT_AFTER_SAVE_SECTION',
140 140
                         __METHOD__
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             Event::on(
158 158
                 Sections::class,
159 159
                 Sections::EVENT_AFTER_DELETE_SECTION,
160
-                function (SectionEvent $event) {
160
+                function(SectionEvent $event) {
161 161
                     Craft::debug(
162 162
                         'Sections::EVENT_AFTER_DELETE_SECTION',
163 163
                         __METHOD__
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         Event::on(
187 187
             Entry::class,
188 188
             Entry::EVENT_DEFINE_SIDEBAR_HTML,
189
-            static function (DefineHtmlEvent $event) {
189
+            static function(DefineHtmlEvent $event) {
190 190
                 Craft::debug(
191 191
                     'Entry::EVENT_DEFINE_SIDEBAR_HTML',
192 192
                     __METHOD__
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
             ->limit($metaBundle->metaSitemapVars->sitemapLimit);
228 228
         if ($metaBundle->sourceType === 'structure'
229 229
             && !empty($metaBundle->metaSitemapVars->structureDepth)) {
230
-            $query->level($metaBundle->metaSitemapVars->structureDepth . '<=');
230
+            $query->level($metaBundle->metaSitemapVars->structureDepth.'<=');
231 231
         }
232 232
 
233 233
         return $query;
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
             ConfigHelper::getConfigFromFile(self::configFilePath()),
396 396
             [
397 397
                 'sourceId' => $sourceModel->id,
398
-                'sourceName' => (string)$sourceModel->name,
398
+                'sourceName' => (string) $sourceModel->name,
399 399
                 'sourceHandle' => $sourceModel->handle,
400 400
                 'sourceType' => $sourceModel->type,
401 401
             ]
Please login to merge, or discard this patch.