Test Failed
Push — develop ( 7257ea...729e02 )
by Andrew
09:10
created
src/controllers/SettingsController.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -154,11 +154,11 @@  discard block
 block discarded – undo
154 154
         foreach ($variables['metaBundles'] as $metaBundle) {
155 155
             $stat = 0;
156 156
             foreach (self::SEO_SETUP_FIELDS as $setupField => $setupLabel) {
157
-                $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]);
157
+                $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]);
158 158
                 $value = $variables['contentSetupChecklist'][$setupField]['value'] ?? 0;
159 159
                 $variables['contentSetupChecklist'][$setupField] = [
160 160
                     'label' => $setupLabel,
161
-                    'value' => $value + (int)!empty($metaBundle->metaGlobalVars[$setupField]),
161
+                    'value' => $value + (int) !empty($metaBundle->metaGlobalVars[$setupField]),
162 162
                 ];
163 163
             }
164 164
             $stat = round($numGrades - (($stat * $numGrades) / $numFields));
@@ -169,16 +169,16 @@  discard block
 block discarded – undo
169 169
         }
170 170
         // Global SEO grades
171 171
         Seomatic::$previewingMetaContainers = true;
172
-        $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int)$siteId);
172
+        $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int) $siteId);
173 173
         Seomatic::$previewingMetaContainers = false;
174 174
         if ($metaBundle !== null) {
175 175
             $stat = 0;
176 176
             $variables['globalSetupChecklist'] = [];
177 177
             foreach (self::SEO_SETUP_FIELDS as $setupField => $setupLabel) {
178
-                $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]);
178
+                $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]);
179 179
                 $variables['globalSetupChecklist'][$setupField] = [
180 180
                     'label' => $setupLabel,
181
-                    'value' => (int)!empty($metaBundle->metaGlobalVars[$setupField]),
181
+                    'value' => (int) !empty($metaBundle->metaGlobalVars[$setupField]),
182 182
                 ];
183 183
             }
184 184
             $stat = round(($stat / $numFields) * 100);
@@ -188,17 +188,17 @@  discard block
 block discarded – undo
188 188
             $stat = 0;
189 189
             $variables['siteSetupChecklist'] = [];
190 190
             foreach (self::SITE_SETUP_FIELDS as $setupField => $setupLabel) {
191
-                $stat += (int)!empty($metaBundle->metaSiteVars[$setupField]);
191
+                $stat += (int) !empty($metaBundle->metaSiteVars[$setupField]);
192 192
                 $variables['siteSetupChecklist'][$setupField] = [
193 193
                     'label' => $setupLabel,
194
-                    'value' => (int)!empty($metaBundle->metaSiteVars[$setupField]),
194
+                    'value' => (int) !empty($metaBundle->metaSiteVars[$setupField]),
195 195
                 ];
196 196
             }
197 197
             foreach (self::IDENTITY_SETUP_FIELDS as $setupField => $setupLabel) {
198
-                $stat += (int)!empty($metaBundle->metaSiteVars->identity[$setupField]);
198
+                $stat += (int) !empty($metaBundle->metaSiteVars->identity[$setupField]);
199 199
                 $variables['siteSetupChecklist'][$setupField] = [
200 200
                     'label' => $setupLabel,
201
-                    'value' => (int)!empty($metaBundle->metaSiteVars->identity[$setupField]),
201
+                    'value' => (int) !empty($metaBundle->metaSiteVars->identity[$setupField]),
202 202
                 ];
203 203
             }
204 204
             $stat = round(($stat / $numFields) * 100);
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
         // Get the site to copy the settings from, if any
273 273
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
274 274
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
275
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
275
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
276 276
         // Load the metabundle
277 277
         $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad);
278 278
         Seomatic::$previewingMetaContainers = false;
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
         // Preview the meta containers
311 311
         Seomatic::$plugin->metaContainers->previewMetaContainers(
312 312
             MetaBundles::GLOBAL_META_BUNDLE,
313
-            (int)$variables['currentSiteId']
313
+            (int) $variables['currentSiteId']
314 314
         );
315 315
         // Render the template
316 316
         return $this->renderTemplate('seomatic/settings/global/'.$subSection, $variables);
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
         // Get the site to edit
455 455
         $siteId = $this->getSiteIdFromHandle($siteHandle);
456 456
         if ($typeId !== null && is_string($typeId)) {
457
-            $typeId = (int)$typeId;
457
+            $typeId = (int) $typeId;
458 458
         }
459 459
         // Get the (entry) type menu
460 460
         $typeMenu = [];
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
             $currentType = reset($typeMenu);
469 469
             $variables['currentType'] = $typeMenu[$typeId] ?? $currentType;
470 470
             $variables['currentTypeId'] = $typeId ?? key($typeMenu);
471
-            $typeId = (int)$variables['currentTypeId'];
471
+            $typeId = (int) $variables['currentTypeId'];
472 472
         }
473 473
         $pluginName = Seomatic::$settings->pluginName;
474 474
         // Asset bundle
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
         // Get the site to copy the settings from, if any
490 490
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
491 491
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
492
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
492
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
493 493
         // Load the metabundle
494 494
         $metaBundle = Seomatic::$plugin->metaBundles->getMetaBundleBySourceHandle(
495 495
             $sourceBundleType,
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
         // Preview the meta containers
558 558
         Seomatic::$plugin->metaContainers->previewMetaContainers(
559 559
             $uri,
560
-            (int)$variables['currentSiteId'],
560
+            (int) $variables['currentSiteId'],
561 561
             false,
562 562
             false
563 563
         );
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
         // Get the site to copy the settings from, if any
692 692
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
693 693
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
694
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
694
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
695 695
         // Load the metabundle
696 696
         $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad);
697 697
         Seomatic::$previewingMetaContainers = false;
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
         // Get the site to copy the settings from, if any
837 837
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
838 838
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
839
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
839
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
840 840
         // Load the metabundle
841 841
         $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad);
842 842
         Seomatic::$previewingMetaContainers = false;
@@ -1117,7 +1117,7 @@  discard block
 block discarded – undo
1117 1117
         if ($variables['showSites']) {
1118 1118
             $variables['sitesMenuLabel'] = Craft::t(
1119 1119
                 'site',
1120
-                $sites->getSiteById((int)$variables['currentSiteId'])->name
1120
+                $sites->getSiteById((int) $variables['currentSiteId'])->name
1121 1121
             );
1122 1122
         } else {
1123 1123
             $variables['sitesMenuLabel'] = '';
Please login to merge, or discard this patch.