Passed
Branch v4 (1742ce)
by Andrew
35:40 queued 22:05
created
src/services/Sitemaps.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
     // Constants
43 43
     // =========================================================================
44 44
 
45
-    const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapIndexTemplate::TEMPLATE_TYPE;
45
+    const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapIndexTemplate::TEMPLATE_TYPE;
46 46
 
47
-    const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapTemplate::TEMPLATE_TYPE;
47
+    const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapTemplate::TEMPLATE_TYPE;
48 48
 
49
-    const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapCustomTemplate::TEMPLATE_TYPE;
49
+    const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapCustomTemplate::TEMPLATE_TYPE;
50 50
 
51 51
     const SEARCH_ENGINE_SUBMISSION_URLS = [
52 52
     ];
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             Event::on(
91 91
                 UrlManager::class,
92 92
                 UrlManager::EVENT_REGISTER_SITE_URL_RULES,
93
-                function (RegisterUrlRulesEvent $event) {
93
+                function(RegisterUrlRulesEvent $event) {
94 94
                     Craft::debug(
95 95
                         'UrlManager::EVENT_REGISTER_SITE_URL_RULES',
96 96
                         __METHOD__
@@ -243,19 +243,19 @@  discard block
 block discarded – undo
243 243
                         $siteId = $groupSiteIds[0];
244 244
                         $sitemapIndexUrl = $this->sitemapIndexUrlForSiteId($siteId);
245 245
                         if (!empty($sitemapIndexUrl)) {
246
-                            $submissionUrl = $url . urlencode($sitemapIndexUrl);
246
+                            $submissionUrl = $url.urlencode($sitemapIndexUrl);
247 247
                             // create new guzzle client
248 248
                             $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]);
249 249
                             // Submit the sitemap index to each search engine
250 250
                             try {
251 251
                                 $guzzleClient->post($submissionUrl);
252 252
                                 Craft::info(
253
-                                    'Sitemap index submitted to: ' . $submissionUrl,
253
+                                    'Sitemap index submitted to: '.$submissionUrl,
254 254
                                     __METHOD__
255 255
                                 );
256 256
                             } catch (\Exception $e) {
257 257
                                 Craft::error(
258
-                                    'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(),
258
+                                    'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(),
259 259
                                     __METHOD__
260 260
                                 );
261 261
                             }
@@ -315,19 +315,19 @@  discard block
 block discarded – undo
315 315
             foreach ($searchEngineUrls as &$url) {
316 316
                 $sitemapUrl = $this->sitemapUrlForBundle($sourceBundleType, $sourceHandle, $sourceSiteId);
317 317
                 if (!empty($sitemapUrl)) {
318
-                    $submissionUrl = $url . urlencode($sitemapUrl);
318
+                    $submissionUrl = $url.urlencode($sitemapUrl);
319 319
                     // create new guzzle client
320 320
                     $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]);
321 321
                     // Submit the sitemap index to each search engine
322 322
                     try {
323 323
                         $guzzleClient->post($submissionUrl);
324 324
                         Craft::info(
325
-                            'Sitemap index submitted to: ' . $submissionUrl,
325
+                            'Sitemap index submitted to: '.$submissionUrl,
326 326
                             __METHOD__
327 327
                         );
328 328
                     } catch (\Exception $e) {
329 329
                         Craft::error(
330
-                            'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(),
330
+                            'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(),
331 331
                             __METHOD__
332 332
                         );
333 333
                     }
@@ -393,19 +393,19 @@  discard block
 block discarded – undo
393 393
             foreach ($searchEngineUrls as &$url) {
394 394
                 $sitemapUrl = $this->sitemapCustomUrlForSiteId($siteId);
395 395
                 if (!empty($sitemapUrl)) {
396
-                    $submissionUrl = $url . urlencode($sitemapUrl);
396
+                    $submissionUrl = $url.urlencode($sitemapUrl);
397 397
                     // create new guzzle client
398 398
                     $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]);
399 399
                     // Submit the sitemap index to each search engine
400 400
                     try {
401 401
                         $guzzleClient->post($submissionUrl);
402 402
                         Craft::info(
403
-                            'Sitemap Custom submitted to: ' . $submissionUrl,
403
+                            'Sitemap Custom submitted to: '.$submissionUrl,
404 404
                             __METHOD__
405 405
                         );
406 406
                     } catch (\Exception $e) {
407 407
                         Craft::error(
408
-                            'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(),
408
+                            'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(),
409 409
                             __METHOD__
410 410
                         );
411 411
                     }
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
         }
484 484
 
485 485
         foreach ($sites as $site) {
486
-            $result .= 'sitemap: ' . $this->sitemapIndexUrlForSiteId($site->id) . PHP_EOL;
486
+            $result .= 'sitemap: '.$this->sitemapIndexUrlForSiteId($site->id).PHP_EOL;
487 487
         }
488 488
 
489 489
         return rtrim($result, PHP_EOL);
@@ -515,9 +515,9 @@  discard block
 block discarded – undo
515 515
         // Since we want a stale-while-revalidate pattern, only invalidate the cache if we're asked to
516 516
         if ($invalidateCache) {
517 517
             $cache = Craft::$app->getCache();
518
-            TagDependency::invalidate($cache, SitemapTemplate::SITEMAP_CACHE_TAG . $handle . $siteId);
518
+            TagDependency::invalidate($cache, SitemapTemplate::SITEMAP_CACHE_TAG.$handle.$siteId);
519 519
             Craft::info(
520
-                'Sitemap cache cleared: ' . $handle,
520
+                'Sitemap cache cleared: '.$handle,
521 521
                 __METHOD__
522 522
             );
523 523
         }
Please login to merge, or discard this patch.
src/models/Settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@
 block discarded – undo
208 208
      *     'default' => 'http://example.com/',
209 209
      *     'spanish' => 'http://example.com/es/',
210 210
      * ],     */
211
-    public string|array $siteUrlOverride = '';
211
+    public string | array $siteUrlOverride = '';
212 212
 
213 213
     /**
214 214
      * @var int
Please login to merge, or discard this patch.
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, '/');
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
             }
83 83
         }
84 84
 
85
-        return rtrim($url, '/') . '/' . ltrim(substr($path, $overlap), '/');
85
+        return rtrim($url, '/').'/'.ltrim(substr($path, $overlap), '/');
86 86
     }
87 87
 
88 88
     /**
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
         // Handle trailing slashes properly for generated URLs
151 151
         $generalConfig = Craft::$app->getConfig()->getGeneral();
152 152
         if ($generalConfig->addTrailingSlashesToUrls && !preg_match('/\.[^\/]+$/', $url)) {
153
-            $url = rtrim($url, '/') . '/';
153
+            $url = rtrim($url, '/').'/';
154 154
         }
155 155
         if (!$generalConfig->addTrailingSlashesToUrls) {
156 156
             $url = rtrim($url, '/');
@@ -170,13 +170,13 @@  discard block
 block discarded – undo
170 170
         $urlParts = parse_url($url);
171 171
         $encodedUrl = "";
172 172
         if (isset($urlParts['scheme'])) {
173
-            $encodedUrl .= $urlParts['scheme'] . '://';
173
+            $encodedUrl .= $urlParts['scheme'].'://';
174 174
         }
175 175
         if (isset($urlParts['host'])) {
176 176
             $encodedUrl .= $urlParts['host'];
177 177
         }
178 178
         if (isset($urlParts['port'])) {
179
-            $encodedUrl .= ':' . $urlParts['port'];
179
+            $encodedUrl .= ':'.$urlParts['port'];
180 180
         }
181 181
         if (isset($urlParts['path'])) {
182 182
             $encodedUrl .= $urlParts['path'];
@@ -186,15 +186,15 @@  discard block
 block discarded – undo
186 186
             foreach ($query as $j => $value) {
187 187
                 $value = explode('=', $value, 2);
188 188
                 if (count($value) === 2) {
189
-                    $query[$j] = urlencode($value[0]) . '=' . urlencode($value[1]);
189
+                    $query[$j] = urlencode($value[0]).'='.urlencode($value[1]);
190 190
                 } else {
191 191
                     $query[$j] = urlencode($value[0]);
192 192
                 }
193 193
             }
194
-            $encodedUrl .= '?' . implode('&', $query);
194
+            $encodedUrl .= '?'.implode('&', $query);
195 195
         }
196 196
         if (isset($urlParts['fragment'])) {
197
-            $encodedUrl .= '#' . $urlParts['fragment'];
197
+            $encodedUrl .= '#'.$urlParts['fragment'];
198 198
         }
199 199
 
200 200
         return $encodedUrl;
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
             if ($siteId !== null) {
235 235
                 $site = $sites->getSiteById($siteId, true);
236 236
                 if (!$site) {
237
-                    throw new Exception('Invalid site ID: ' . $siteId);
237
+                    throw new Exception('Invalid site ID: '.$siteId);
238 238
                 }
239 239
             }
240 240
 
@@ -260,11 +260,11 @@  discard block
 block discarded – undo
260 260
 
261 261
         if (filter_var($pathOrUrl, FILTER_VALIDATE_URL)) {
262 262
             $url_parts = parse_url($pathOrUrl);
263
-            $result['prefix'] = $url_parts['scheme'] . '://' . $url_parts['host'];
263
+            $result['prefix'] = $url_parts['scheme'].'://'.$url_parts['host'];
264 264
             $result['path'] = $url_parts['path'] ?? '';
265 265
             $result['suffix'] = '';
266
-            $result['suffix'] .= empty($url_parts['query']) ? '' : '?' . $url_parts['query'];
267
-            $result['suffix'] .= empty($url_parts['fragment']) ? '' : '#' . $url_parts['fragment'];
266
+            $result['suffix'] .= empty($url_parts['query']) ? '' : '?'.$url_parts['query'];
267
+            $result['suffix'] .= empty($url_parts['fragment']) ? '' : '#'.$url_parts['fragment'];
268 268
         } else {
269 269
             $result['prefix'] = '';
270 270
             $result['path'] = $pathOrUrl;
Please login to merge, or discard this patch.
src/Seomatic.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
             $lastSegment = end($segments);
347 347
             $site = Craft::$app->getSites()->getSiteByHandle($lastSegment);
348 348
             if ($site !== null) {
349
-                $siteSuffix = '/' . $lastSegment;
349
+                $siteSuffix = '/'.$lastSegment;
350 350
             }
351 351
         }
352 352
         $currentUser = Craft::$app->getUser()->getIdentity();
@@ -354,31 +354,31 @@  discard block
 block discarded – undo
354 354
         if ($currentUser->can('seomatic:dashboard')) {
355 355
             $subNavs['dashboard'] = [
356 356
                 'label' => Craft::t('seomatic', 'Dashboard'),
357
-                'url' => 'seomatic/dashboard' . $siteSuffix,
357
+                'url' => 'seomatic/dashboard'.$siteSuffix,
358 358
             ];
359 359
         }
360 360
         if ($currentUser->can('seomatic:global-meta')) {
361 361
             $subNavs['global'] = [
362 362
                 'label' => Craft::t('seomatic', 'Global SEO'),
363
-                'url' => 'seomatic/global/general' . $siteSuffix,
363
+                'url' => 'seomatic/global/general'.$siteSuffix,
364 364
             ];
365 365
         }
366 366
         if ($currentUser->can('seomatic:content-meta')) {
367 367
             $subNavs['content'] = [
368 368
                 'label' => Craft::t('seomatic', 'Content SEO'),
369
-                'url' => 'seomatic/content' . $siteSuffix,
369
+                'url' => 'seomatic/content'.$siteSuffix,
370 370
             ];
371 371
         }
372 372
         if ($currentUser->can('seomatic:site-settings')) {
373 373
             $subNavs['site'] = [
374 374
                 'label' => Craft::t('seomatic', 'Site Settings'),
375
-                'url' => 'seomatic/site/identity' . $siteSuffix,
375
+                'url' => 'seomatic/site/identity'.$siteSuffix,
376 376
             ];
377 377
         }
378 378
         if ($currentUser->can('seomatic:tracking-scripts')) {
379 379
             $subNavs['tracking'] = [
380 380
                 'label' => Craft::t('seomatic', 'Tracking Scripts'),
381
-                'url' => 'seomatic/tracking/gtag' . $siteSuffix,
381
+                'url' => 'seomatic/tracking/gtag'.$siteSuffix,
382 382
             ];
383 383
         }
384 384
         $editableSettings = true;
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
         Event::on(
424 424
             Plugins::class,
425 425
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
426
-            function (PluginEvent $event) {
426
+            function(PluginEvent $event) {
427 427
                 if ($event->plugin === $this) {
428 428
                     // Invalidate our caches after we've been installed
429 429
                     $this->clearAllCaches();
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
         Event::on(
445 445
             ClearCaches::class,
446 446
             ClearCaches::EVENT_REGISTER_CACHE_OPTIONS,
447
-            function (RegisterCacheOptionsEvent $event) {
447
+            function(RegisterCacheOptionsEvent $event) {
448 448
                 Craft::debug(
449 449
                     'ClearCaches::EVENT_REGISTER_CACHE_OPTIONS',
450 450
                     __METHOD__
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
         Event::on(
461 461
             Plugins::class,
462 462
             Plugins::EVENT_BEFORE_SAVE_PLUGIN_SETTINGS,
463
-            function (PluginEvent $event) {
463
+            function(PluginEvent $event) {
464 464
                 if ($event->plugin === $this && !Craft::$app->getDb()->getSupportsMb4()) {
465 465
                     // For all the emojis
466 466
                     $settingsModel = $this->getSettings();
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
         Event::on(
491 491
             Plugins::class,
492 492
             Plugins::EVENT_AFTER_LOAD_PLUGINS,
493
-            function () {
493
+            function() {
494 494
                 // Delay registering SEO Elements to give other plugins a chance to load first
495 495
                 $this->seoElements->getAllSeoElementTypes(false);
496 496
                 // Delay installing GQL handlers to give other plugins a chance to register their own first
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
         Event::on(
512 512
             Fields::class,
513 513
             Fields::EVENT_REGISTER_FIELD_TYPES,
514
-            static function (RegisterComponentTypesEvent $event) {
514
+            static function(RegisterComponentTypesEvent $event) {
515 515
                 $event->types[] = SeoSettingsField::class;
516 516
                 $event->types[] = Seomatic_MetaField::class;
517 517
             }
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
         Event::on(
521 521
             Element::class,
522 522
             Element::EVENT_AFTER_PROPAGATE,
523
-            static function (ModelEvent $event) {
523
+            static function(ModelEvent $event) {
524 524
                 Craft::debug(
525 525
                     'Element::EVENT_AFTER_PROPAGATE',
526 526
                     __METHOD__
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
         Event::on(
541 541
             Elements::class,
542 542
             Elements::EVENT_AFTER_DELETE_ELEMENT,
543
-            static function (ElementEvent $event) {
543
+            static function(ElementEvent $event) {
544 544
                 Craft::debug(
545 545
                     'Elements::EVENT_AFTER_DELETE_ELEMENT',
546 546
                     __METHOD__
@@ -559,19 +559,19 @@  discard block
 block discarded – undo
559 559
             Event::on(
560 560
                 Entry::class,
561 561
                 Element::EVENT_REGISTER_PREVIEW_TARGETS,
562
-                static function (RegisterPreviewTargetsEvent $e) {
562
+                static function(RegisterPreviewTargetsEvent $e) {
563 563
                     /** @var Element $element */
564 564
                     $element = $e->sender;
565 565
                     if ($element->uri !== null) {
566 566
                         $e->previewTargets[] = [
567
-                            'label' => '
Please login to merge, or discard this patch.