Passed
Push — develop ( 1cdd96...bece07 )
by Andrew
19:05 queued 09:51
created
src/helpers/UrlHelper.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
             $siteUrl = MetaValue::parseString($siteUrl);
45 45
             // Extract out just the path part
46 46
             $parts = self::decomposeUrl($path);
47
-            $path = $parts['path'] . $parts['suffix'];
47
+            $path = $parts['path'].$parts['suffix'];
48 48
             $url = self::mergeUrlWithPath($siteUrl, $path);
49 49
             // Handle trailing slashes properly for generated URLs
50 50
             $generalConfig = Craft::$app->getConfig()->getGeneral();
51 51
             if ($generalConfig->addTrailingSlashesToUrls && !preg_match('/\.[^\/]+$/', $url)) {
52
-                $url = rtrim($url, '/') . '/';
52
+                $url = rtrim($url, '/').'/';
53 53
             }
54 54
             if (!$generalConfig->addTrailingSlashesToUrls) {
55 55
                 $url = rtrim($url, '/');
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             }
86 86
         }
87 87
 
88
-        return $url . '/' . ltrim(substr($path, $overlap), '/');
88
+        return $url.'/'.ltrim(substr($path, $overlap), '/');
89 89
     }
90 90
 
91 91
     /**
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         // Handle trailing slashes properly for generated URLs
154 154
         $generalConfig = Craft::$app->getConfig()->getGeneral();
155 155
         if ($generalConfig->addTrailingSlashesToUrls && !preg_match('/\.[^\/]+$/', $url)) {
156
-            $url = rtrim($url, '/') . '/';
156
+            $url = rtrim($url, '/').'/';
157 157
         }
158 158
         if (!$generalConfig->addTrailingSlashesToUrls) {
159 159
             $url = rtrim($url, '/');
@@ -173,13 +173,13 @@  discard block
 block discarded – undo
173 173
         $urlParts = parse_url($url);
174 174
         $encodedUrl = "";
175 175
         if (isset($urlParts['scheme'])) {
176
-            $encodedUrl .= $urlParts['scheme'] . '://';
176
+            $encodedUrl .= $urlParts['scheme'].'://';
177 177
         }
178 178
         if (isset($urlParts['host'])) {
179 179
             $encodedUrl .= $urlParts['host'];
180 180
         }
181 181
         if (isset($urlParts['port'])) {
182
-            $encodedUrl .= ':' . $urlParts['port'];
182
+            $encodedUrl .= ':'.$urlParts['port'];
183 183
         }
184 184
         if (isset($urlParts['path'])) {
185 185
             $encodedUrl .= $urlParts['path'];
@@ -189,15 +189,15 @@  discard block
 block discarded – undo
189 189
             foreach ($query as $j => $value) {
190 190
                 $value = explode('=', $value, 2);
191 191
                 if (count($value) === 2) {
192
-                    $query[$j] = urlencode($value[0]) . '=' . urlencode($value[1]);
192
+                    $query[$j] = urlencode($value[0]).'='.urlencode($value[1]);
193 193
                 } else {
194 194
                     $query[$j] = urlencode($value[0]);
195 195
                 }
196 196
             }
197
-            $encodedUrl .= '?' . implode('&', $query);
197
+            $encodedUrl .= '?'.implode('&', $query);
198 198
         }
199 199
         if (isset($urlParts['fragment'])) {
200
-            $encodedUrl .= '#' . $urlParts['fragment'];
200
+            $encodedUrl .= '#'.$urlParts['fragment'];
201 201
         }
202 202
 
203 203
         return $encodedUrl;
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
             if ($siteId !== null) {
238 238
                 $site = $sites->getSiteById($siteId, true);
239 239
                 if (!$site) {
240
-                    throw new Exception('Invalid site ID: ' . $siteId);
240
+                    throw new Exception('Invalid site ID: '.$siteId);
241 241
                 }
242 242
             }
243 243
 
@@ -263,11 +263,11 @@  discard block
 block discarded – undo
263 263
 
264 264
         if (filter_var($pathOrUrl, FILTER_VALIDATE_URL)) {
265 265
             $url_parts = parse_url($pathOrUrl);
266
-            $result['prefix'] = $url_parts['scheme'] . '://' . $url_parts['host'];
266
+            $result['prefix'] = $url_parts['scheme'].'://'.$url_parts['host'];
267 267
             $result['path'] = $url_parts['path'] ?? '';
268 268
             $result['suffix'] = '';
269
-            $result['suffix'] .= empty($url_parts['query']) ? '' : '?' . $url_parts['query'];
270
-            $result['suffix'] .= empty($url_parts['fragment']) ? '' : '#' . $url_parts['fragment'];
269
+            $result['suffix'] .= empty($url_parts['query']) ? '' : '?'.$url_parts['query'];
270
+            $result['suffix'] .= empty($url_parts['fragment']) ? '' : '#'.$url_parts['fragment'];
271 271
         } else {
272 272
             $result['prefix'] = '';
273 273
             $result['path'] = $pathOrUrl;
Please login to merge, or discard this patch.