Passed
Branch v3 (6ce356)
by Andrew
11:37 queued 02:32
created
src/controllers/SettingsController.php 1 patch
Spacing   +17 added lines, -17 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
 
460 460
         $pluginName = Seomatic::$settings->pluginName;
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
         // Get the site to copy the settings from, if any
477 477
         $variables['loadFromSiteHandle'] = $loadFromSiteHandle;
478 478
         $loadFromSiteId = $this->getSiteIdFromHandle($loadFromSiteHandle);
479
-        $siteIdToLoad = $loadFromSiteHandle === null ? (int)$variables['currentSiteId'] : $loadFromSiteId;
479
+        $siteIdToLoad = $loadFromSiteHandle === null ? (int) $variables['currentSiteId'] : $loadFromSiteId;
480 480
         // Load the metabundle
481 481
         $metaBundle = Seomatic::$plugin->metaBundles->getMetaBundleBySourceHandle(
482 482
             $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.
src/models/MetaTitle.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
                 $suffix = '';
157 157
             }
158 158
             // Remove potential double spaces
159
-            $prefix = preg_replace('/\s+/', ' ', $prefix);;
160
-            $suffix = preg_replace('/\s+/', ' ', $suffix);;
159
+            $prefix = preg_replace('/\s+/', ' ', $prefix); ;
160
+            $suffix = preg_replace('/\s+/', ' ', $suffix); ;
161 161
             $lengthAdjust = mb_strlen($prefix.$suffix);
162 162
             // Parse the data
163 163
             $scenario = $this->scenario;
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
                 $truncLen = 0;
171 171
             }
172 172
             if (!empty($data)) {
173
-                $data = (string)Stringy::create($data)->safeTruncate(
173
+                $data = (string) Stringy::create($data)->safeTruncate(
174 174
                     $truncLen,
175 175
                     '…'
176 176
                 );
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
             $data = trim($data);
181 181
             // devMode
182 182
             if (Seomatic::$devMode) {
183
-                $data = Seomatic::$settings->devModeTitlePrefix . $data;
183
+                $data = Seomatic::$settings->devModeTitlePrefix.$data;
184 184
             }
185 185
         }
186 186
 
Please login to merge, or discard this patch.
src/helpers/UrlHelper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             // Handle trailing slashes properly for generated URLs
48 48
             $generalConfig = Craft::$app->getConfig()->getGeneral();
49 49
             if ($generalConfig->addTrailingSlashesToUrls && !preg_match('/\.[^\/]+$/', $url)) {
50
-                $url = rtrim($url, '/') . '/';
50
+                $url = rtrim($url, '/').'/';
51 51
             }
52 52
             if (!$generalConfig->addTrailingSlashesToUrls) {
53 53
                 $url = rtrim($url, '/');
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         // Handle trailing slashes properly for generated URLs
125 125
         $generalConfig = Craft::$app->getConfig()->getGeneral();
126 126
         if ($generalConfig->addTrailingSlashesToUrls && !preg_match('/\.[^\/]+$/', $url)) {
127
-            $url = rtrim($url, '/') . '/';
127
+            $url = rtrim($url, '/').'/';
128 128
         }
129 129
         if (!$generalConfig->addTrailingSlashesToUrls) {
130 130
             $url = rtrim($url, '/');
@@ -149,11 +149,11 @@  discard block
 block discarded – undo
149 149
 
150 150
         if (filter_var($pathOrUrl, FILTER_VALIDATE_URL)) {
151 151
             $url_parts = parse_url($pathOrUrl);
152
-            $result['prefix'] = $url_parts['scheme'] . '://' . $url_parts['host'];
152
+            $result['prefix'] = $url_parts['scheme'].'://'.$url_parts['host'];
153 153
             $result['path'] = $url_parts['path'];
154 154
             $result['suffix'] = '';
155
-            $result['suffix'] .= empty($url_parts['query']) ? '' : '?' . $url_parts['query'];
156
-            $result['suffix'] .= empty($url_parts['fragment']) ? '' : '#' . $url_parts['fragment'];
155
+            $result['suffix'] .= empty($url_parts['query']) ? '' : '?'.$url_parts['query'];
156
+            $result['suffix'] .= empty($url_parts['fragment']) ? '' : '#'.$url_parts['fragment'];
157 157
         } else {
158 158
             $result['prefix'] = '';
159 159
             $result['path'] = $pathOrUrl;
Please login to merge, or discard this patch.