Passed
Push — develop ( 48e2ee...94d473 )
by Andrew
09:54
created
src/controllers/SettingsController.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -156,11 +156,11 @@  discard block
 block discarded – undo
156 156
         foreach ($variables['metaBundles'] as $metaBundle) {
157 157
             $stat = 0;
158 158
             foreach (self::SEO_SETUP_FIELDS as $setupField => $setupLabel) {
159
-                $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]);
159
+                $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]);
160 160
                 $value = $variables['contentSetupChecklist'][$setupField]['value'] ?? 0;
161 161
                 $variables['contentSetupChecklist'][$setupField] = [
162 162
                     'label' => $setupLabel,
163
-                    'value' => $value + (int)!empty($metaBundle->metaGlobalVars[$setupField]),
163
+                    'value' => $value + (int) !empty($metaBundle->metaGlobalVars[$setupField]),
164 164
                 ];
165 165
             }
166 166
             $stat = round($numGrades - (($stat * $numGrades) / $numFields));
@@ -171,16 +171,16 @@  discard block
 block discarded – undo
171 171
         }
172 172
         // Global SEO grades
173 173
         Seomatic::$previewingMetaContainers = true;
174
-        $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int)$siteId);
174
+        $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle((int) $siteId);
175 175
         Seomatic::$previewingMetaContainers = false;
176 176
         if ($metaBundle !== null) {
177 177
             $stat = 0;
178 178
             $variables['globalSetupChecklist'] = [];
179 179
             foreach (self::SEO_SETUP_FIELDS as $setupField => $setupLabel) {
180
-                $stat += (int)!empty($metaBundle->metaGlobalVars[$setupField]);
180
+                $stat += (int) !empty($metaBundle->metaGlobalVars[$setupField]);
181 181
                 $variables['globalSetupChecklist'][$setupField] = [
182 182
                     'label' => $setupLabel,
183
-                    'value' => (int)!empty($metaBundle->metaGlobalVars[$setupField]),
183
+                    'value' => (int) !empty($metaBundle->metaGlobalVars[$setupField]),
184 184
                 ];
185 185
             }
186 186
             $stat = round(($stat / $numFields) * 100);
@@ -190,17 +190,17 @@  discard block
 block discarded – undo
190 190
             $stat = 0;
191 191
             $variables['siteSetupChecklist'] = [];
192 192
             foreach (self::SITE_SETUP_FIELDS as $setupField => $setupLabel) {
193
-                $stat += (int)!empty($metaBundle->metaSiteVars[$setupField]);
193
+                $stat += (int) !empty($metaBundle->metaSiteVars[$setupField]);
194 194
                 $variables['siteSetupChecklist'][$setupField] = [
195 195
                     'label' => $setupLabel,
196
-                    'value' => (int)!empty($metaBundle->metaSiteVars[$setupField]),
196
+                    'value' => (int) !empty($metaBundle->metaSiteVars[$setupField]),
197 197
                 ];
198 198
             }
199 199
             foreach (self::IDENTITY_SETUP_FIELDS as $setupField => $setupLabel) {
200
-                $stat += (int)!empty($metaBundle->metaSiteVars->identity[$setupField]);
200
+                $stat += (int) !empty($metaBundle->metaSiteVars->identity[$setupField]);
201 201
                 $variables['siteSetupChecklist'][$setupField] = [
202 202
                     'label' => $setupLabel,
203
-                    'value' => (int)!empty($metaBundle->metaSiteVars->identity[$setupField]),
203
+                    'value' => (int) !empty($metaBundle->metaSiteVars->identity[$setupField]),
204 204
                 ];
205 205
             }
206 206
             $stat = round(($stat / $numFields) * 100);
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
         // Get the site to copy the settings from, if any
275 275
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
276 276
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
277
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
277
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
278 278
         // Load the metabundle
279 279
         $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad);
280 280
         if ($editedMetaBundle) {
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
         // Preview the meta containers
323 323
         Seomatic::$plugin->metaContainers->previewMetaContainers(
324 324
             MetaBundles::GLOBAL_META_BUNDLE,
325
-            (int)$variables['currentSiteId']
325
+            (int) $variables['currentSiteId']
326 326
         );
327 327
 
328 328
         // Render the template
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
         // Get the site to edit
496 496
         $siteId = $this->getSiteIdFromHandle($siteHandle);
497 497
         if ($typeId !== null && is_string($typeId)) {
498
-            $typeId = (int)$typeId;
498
+            $typeId = (int) $typeId;
499 499
         }
500 500
         // Get the (entry) type menu
501 501
         $typeMenu = [];
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
             $currentType = reset($typeMenu);
510 510
             $variables['currentType'] = $typeMenu[$typeId] ?? $currentType;
511 511
             $variables['currentTypeId'] = $typeId ?? key($typeMenu);
512
-            $typeId = (int)$variables['currentTypeId'];
512
+            $typeId = (int) $variables['currentTypeId'];
513 513
         }
514 514
         $pluginName = Seomatic::$settings->pluginName;
515 515
         // Asset bundle
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
         // Get the site to copy the settings from, if any
531 531
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
532 532
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
533
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
533
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
534 534
         // Load the metabundle
535 535
         $metaBundle = Seomatic::$plugin->metaBundles->getMetaBundleBySourceHandle(
536 536
             $sourceBundleType,
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
         // Preview the meta containers
599 599
         Seomatic::$plugin->metaContainers->previewMetaContainers(
600 600
             $uri,
601
-            (int)$variables['currentSiteId'],
601
+            (int) $variables['currentSiteId'],
602 602
             false,
603 603
             false
604 604
         );
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
         // Get the site to copy the settings from, if any
733 733
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
734 734
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
735
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
735
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
736 736
         // Load the metabundle
737 737
         $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad);
738 738
         Seomatic::$previewingMetaContainers = false;
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
         // Get the site to copy the settings from, if any
878 878
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
879 879
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
880
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
880
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
881 881
         // Load the metabundle
882 882
         $metaBundle = Seomatic::$plugin->metaBundles->getGlobalMetaBundle($siteIdToLoad);
883 883
         if ($editedMetaBundle) {
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
         if ($variables['showSites']) {
1177 1177
             $variables['sitesMenuLabel'] = Craft::t(
1178 1178
                 'site',
1179
-                $sites->getSiteById((int)$variables['currentSiteId'])->name
1179
+                $sites->getSiteById((int) $variables['currentSiteId'])->name
1180 1180
             );
1181 1181
         } else {
1182 1182
             $variables['sitesMenuLabel'] = '';
Please login to merge, or discard this patch.