Passed
Push — v3 ( c32422...11cdfe )
by Andrew
13:45
created
src/seoelements/SeoEntry.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
             ->limit($metaBundle->metaSitemapVars->sitemapLimit);
223 223
         if ($metaBundle->sourceType === 'structure'
224 224
             && !empty($metaBundle->metaSitemapVars->structureDepth)) {
225
-            $query->level($metaBundle->metaSitemapVars->structureDepth . '<=');
225
+            $query->level($metaBundle->metaSitemapVars->structureDepth.'<=');
226 226
         }
227 227
 
228 228
         return $query;
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
             ConfigHelper::getConfigFromFile(self::configFilePath()),
390 390
             [
391 391
                 'sourceId' => $sourceModel->id,
392
-                'sourceName' => (string)$sourceModel->name,
392
+                'sourceName' => (string) $sourceModel->name,
393 393
                 'sourceHandle' => $sourceModel->handle,
394 394
                 'sourceType' => $sourceModel->type,
395 395
             ]
Please login to merge, or discard this patch.
src/seoelements/SeoEvent.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
         $query
242 242
             ->setCalendar($metaBundle->sourceHandle)
243 243
             ->setLoadOccurrences(false)
244
-            ->siteId((int)$metaBundle->sourceSiteId)
245
-            ->limit((int)$metaBundle->metaSitemapVars->sitemapLimit);
244
+            ->siteId((int) $metaBundle->sourceSiteId)
245
+            ->limit((int) $metaBundle->metaSitemapVars->sitemapLimit);
246 246
 
247 247
         return $query;
248 248
     }
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
             ConfigHelper::getConfigFromFile(self::configFilePath()),
406 406
             [
407 407
                 'sourceId' => $sourceModel->id,
408
-                'sourceName' => (string)$sourceModel->name,
408
+                'sourceName' => (string) $sourceModel->name,
409 409
                 'sourceHandle' => $sourceModel->handle,
410 410
             ]
411 411
         );
Please login to merge, or discard this patch.
src/seoelements/SeoCategory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
             ->siteId($metaBundle->sourceSiteId)
219 219
             ->limit($metaBundle->metaSitemapVars->sitemapLimit);
220 220
         if (!empty($metaBundle->metaSitemapVars->structureDepth)) {
221
-            $query->level($metaBundle->metaSitemapVars->structureDepth . '<=');
221
+            $query->level($metaBundle->metaSitemapVars->structureDepth.'<=');
222 222
         }
223 223
 
224 224
         return $query;
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
             ConfigHelper::getConfigFromFile(self::configFilePath()),
375 375
             [
376 376
                 'sourceId' => $sourceModel->id,
377
-                'sourceName' => (string)$sourceModel->name,
377
+                'sourceName' => (string) $sourceModel->name,
378 378
                 'sourceHandle' => $sourceModel->handle,
379 379
             ]
380 380
         );
Please login to merge, or discard this patch.
src/base/FluentModel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
         // Set the property
68 68
         $value = $args[0];
69 69
         if (is_object($value) && $value instanceof Markup) {
70
-            $value = (string)$value;
70
+            $value = (string) $value;
71 71
         }
72 72
         $property->setValue($this, $value);
73 73
 
Please login to merge, or discard this patch.
src/base/MetaItem.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                 // Add a URL to the schema.org type if this is a MetaJsonLD object
163 163
                 if ($isMetaJsonLdModel) {
164 164
                     /** @var MetaJsonLd $this */
165
-                    $extraInfo = ' for http://schema.org/' . $this->type;
165
+                    $extraInfo = ' for http://schema.org/'.$this->type;
166 166
                 }
167 167
                 $errorMsg =
168 168
                     Craft::t('seomatic', 'Scenario: "')
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
                     . print_r($this->render(), true);
174 174
                 Craft::info($errorMsg, __METHOD__);
175 175
                 foreach ($this->errors as $param => $errors) {
176
-                    $errorMsg = Craft::t('seomatic', $errorLabel) . $param;
176
+                    $errorMsg = Craft::t('seomatic', $errorLabel).$param;
177 177
                     /** @var array $errors */
178 178
                     foreach ($errors as $error) {
179
-                        $errorMsg .= ' -> ' . $error;
179
+                        $errorMsg .= ' -> '.$error;
180 180
                         // Change the error level depending on the error message if this is a MetaJsonLD object
181 181
                         if ($isMetaJsonLdModel) {
182 182
                             if (strpos($error, 'recommended') !== false) {
@@ -189,14 +189,14 @@  discard block
 block discarded – undo
189 189
                             }
190 190
                         }
191 191
                     }
192
-                    Craft::info(strtoupper($logLevel) . ' - ' . $errorMsg, __METHOD__);
192
+                    Craft::info(strtoupper($logLevel).' - '.$errorMsg, __METHOD__);
193 193
                     // Extra debugging info for MetaJsonLd objects
194 194
                     if ($isMetaJsonLdModel) {
195 195
                         /** @var MetaJsonLd $className */
196 196
                         $className = get_class($this);
197 197
                         if (!empty($className->schemaPropertyDescriptions[$param])) {
198
-                            $errorMsg = Craft::t('seomatic', $errorLabel) . $param;
199
-                            $errorMsg .= ' -> ' . $className->schemaPropertyDescriptions[$param];
198
+                            $errorMsg = Craft::t('seomatic', $errorLabel).$param;
199
+                            $errorMsg .= ' -> '.$className->schemaPropertyDescriptions[$param];
200 200
                             Craft::info($errorMsg, __METHOD__);
201 201
                         }
202 202
                     }
Please login to merge, or discard this patch.
src/models/MetaSiteVars.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -238,10 +238,10 @@
 block discarded – undo
238 238
         }
239 239
         // Make sure these are strings
240 240
         if (!empty($this->facebookProfileId)) {
241
-            $this->facebookProfileId = (string)$this->facebookProfileId;
241
+            $this->facebookProfileId = (string) $this->facebookProfileId;
242 242
         }
243 243
         if (!empty($this->facebookAppId)) {
244
-            $this->facebookAppId = (string)$this->facebookAppId;
244
+            $this->facebookAppId = (string) $this->facebookAppId;
245 245
         }
246 246
         // Identity
247 247
         if (is_array($this->identity)) {
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
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
             $siteUrl = MetaValue::parseString($siteUrl);
47 47
             // Extract out just the path part
48 48
             $parts = self::decomposeUrl($path);
49
-            $path = $parts['path'] . $parts['suffix'];
49
+            $path = $parts['path'].$parts['suffix'];
50 50
             $url = self::mergeUrlWithPath($siteUrl, $path);
51 51
             // Handle trailing slashes properly for generated URLs
52 52
             $generalConfig = Craft::$app->getConfig()->getGeneral();
53 53
             if ($generalConfig->addTrailingSlashesToUrls && !preg_match('/(.+\?.*)|(\.[^\/]+$)/', $url)) {
54
-                $url = rtrim($url, '/') . '/';
54
+                $url = rtrim($url, '/').'/';
55 55
             }
56 56
             if (!$generalConfig->addTrailingSlashesToUrls) {
57 57
                 $url = rtrim($url, '/');
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             }
85 85
         }
86 86
 
87
-        return rtrim($url, '/') . '/' . ltrim(substr($path, $overlap), '/');
87
+        return rtrim($url, '/').'/'.ltrim(substr($path, $overlap), '/');
88 88
     }
89 89
 
90 90
     /**
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         // Handle trailing slashes properly for generated URLs
153 153
         $generalConfig = Craft::$app->getConfig()->getGeneral();
154 154
         if ($generalConfig->addTrailingSlashesToUrls && !preg_match('/(.+\?.*)|(\.[^\/]+$)/', $url)) {
155
-            $url = rtrim($url, '/') . '/';
155
+            $url = rtrim($url, '/').'/';
156 156
         }
157 157
         if (!$generalConfig->addTrailingSlashesToUrls) {
158 158
             $url = rtrim($url, '/');
@@ -172,13 +172,13 @@  discard block
 block discarded – undo
172 172
         $urlParts = parse_url($url);
173 173
         $encodedUrl = "";
174 174
         if (isset($urlParts['scheme'])) {
175
-            $encodedUrl .= $urlParts['scheme'] . '://';
175
+            $encodedUrl .= $urlParts['scheme'].'://';
176 176
         }
177 177
         if (isset($urlParts['host'])) {
178 178
             $encodedUrl .= $urlParts['host'];
179 179
         }
180 180
         if (isset($urlParts['port'])) {
181
-            $encodedUrl .= ':' . $urlParts['port'];
181
+            $encodedUrl .= ':'.$urlParts['port'];
182 182
         }
183 183
         if (isset($urlParts['path'])) {
184 184
             $encodedUrl .= $urlParts['path'];
@@ -188,15 +188,15 @@  discard block
 block discarded – undo
188 188
             foreach ($query as $j => $value) {
189 189
                 $value = explode('=', $value, 2);
190 190
                 if (count($value) === 2) {
191
-                    $query[$j] = urlencode($value[0]) . '=' . urlencode($value[1]);
191
+                    $query[$j] = urlencode($value[0]).'='.urlencode($value[1]);
192 192
                 } else {
193 193
                     $query[$j] = urlencode($value[0]);
194 194
                 }
195 195
             }
196
-            $encodedUrl .= '?' . implode('&', $query);
196
+            $encodedUrl .= '?'.implode('&', $query);
197 197
         }
198 198
         if (isset($urlParts['fragment'])) {
199
-            $encodedUrl .= '#' . $urlParts['fragment'];
199
+            $encodedUrl .= '#'.$urlParts['fragment'];
200 200
         }
201 201
 
202 202
         return $encodedUrl;
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
             if ($siteId !== null) {
237 237
                 $site = $sites->getSiteById($siteId, true);
238 238
                 if (!$site) {
239
-                    throw new Exception('Invalid site ID: ' . $siteId);
239
+                    throw new Exception('Invalid site ID: '.$siteId);
240 240
                 }
241 241
             }
242 242
 
@@ -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/fields/SeoSettings.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
         if ($element !== null && $element->uri !== null) {
377 377
             $siteId = $element->siteId;
378 378
             $uri = $element->uri;
379
-            $cacheKey = self::CACHE_KEY . $uri . $siteId . $this->elementDisplayPreviewType;
379
+            $cacheKey = self::CACHE_KEY.$uri.$siteId.$this->elementDisplayPreviewType;
380 380
             $metaBundleSourceType = Seomatic::$plugin->seoElements->getMetaBundleTypeFromElement($element);
381 381
             $seoElement = Seomatic::$plugin->seoElements->getSeoElementByMetaBundleType($metaBundleSourceType);
382 382
             $metaBundleSourceType = SeoEntry::getMetaBundleType();
@@ -387,14 +387,14 @@  discard block
 block discarded – undo
387 387
             $dependency = new TagDependency([
388 388
                 'tags' => [
389 389
                     MetaContainers::GLOBAL_METACONTAINER_CACHE_TAG,
390
-                    MetaContainers::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId,
391
-                    MetaContainers::METACONTAINER_CACHE_TAG . $uri . $siteId,
390
+                    MetaContainers::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId,
391
+                    MetaContainers::METACONTAINER_CACHE_TAG.$uri.$siteId,
392 392
                 ],
393 393
             ]);
394 394
             $cache = Craft::$app->getCache();
395 395
             $cacheDuration = null;
396 396
             $html = $cache->getOrSet(
397
-                self::CACHE_KEY . $cacheKey,
397
+                self::CACHE_KEY.$cacheKey,
398 398
                 function() use ($uri, $siteId, $element) {
399 399
                     Seomatic::$plugin->metaContainers->previewMetaContainers($uri, $siteId, true, true, $element);
400 400
                     $variables = [
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
         array   &$variables
437 437
     ) {
438 438
         $variables['textFieldSources'] = array_merge(
439
-            ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'],
439
+            ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'],
440 440
             FieldHelper::fieldsOfTypeFromElement(
441 441
                 $element,
442 442
                 FieldHelper::TEXT_FIELD_CLASS_KEY,
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
             )
445 445
         );
446 446
         $variables['assetFieldSources'] = array_merge(
447
-            ['entryGroup' => ['optgroup' => $groupName . ' Fields']],
447
+            ['entryGroup' => ['optgroup' => $groupName.' Fields']],
448 448
             FieldHelper::fieldsOfTypeFromElement(
449 449
                 $element,
450 450
                 FieldHelper::ASSET_FIELD_CLASS_KEY,
Please login to merge, or discard this patch.
src/services/Sitemaps.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
     // Constants
44 44
     // =========================================================================
45 45
 
46
-    const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapIndexTemplate::TEMPLATE_TYPE;
46
+    const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapIndexTemplate::TEMPLATE_TYPE;
47 47
 
48
-    const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapTemplate::TEMPLATE_TYPE;
48
+    const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapTemplate::TEMPLATE_TYPE;
49 49
 
50
-    const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapCustomTemplate::TEMPLATE_TYPE;
50
+    const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapCustomTemplate::TEMPLATE_TYPE;
51 51
 
52 52
     const SEARCH_ENGINE_SUBMISSION_URLS = [
53 53
     ];
@@ -247,19 +247,19 @@  discard block
 block discarded – undo
247 247
                         $siteId = $groupSiteIds[0];
248 248
                         $sitemapIndexUrl = $this->sitemapIndexUrlForSiteId($siteId);
249 249
                         if (!empty($sitemapIndexUrl)) {
250
-                            $submissionUrl = $url . urlencode($sitemapIndexUrl);
250
+                            $submissionUrl = $url.urlencode($sitemapIndexUrl);
251 251
                             // create new guzzle client
252 252
                             $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]);
253 253
                             // Submit the sitemap index to each search engine
254 254
                             try {
255 255
                                 $guzzleClient->post($submissionUrl);
256 256
                                 Craft::info(
257
-                                    'Sitemap index submitted to: ' . $submissionUrl,
257
+                                    'Sitemap index submitted to: '.$submissionUrl,
258 258
                                     __METHOD__
259 259
                                 );
260 260
                             } catch (\Exception $e) {
261 261
                                 Craft::error(
262
-                                    'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(),
262
+                                    'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(),
263 263
                                     __METHOD__
264 264
                                 );
265 265
                             }
@@ -321,19 +321,19 @@  discard block
 block discarded – undo
321 321
             foreach ($searchEngineUrls as &$url) {
322 322
                 $sitemapUrl = $this->sitemapUrlForBundle($sourceBundleType, $sourceHandle, $sourceSiteId);
323 323
                 if (!empty($sitemapUrl)) {
324
-                    $submissionUrl = $url . urlencode($sitemapUrl);
324
+                    $submissionUrl = $url.urlencode($sitemapUrl);
325 325
                     // create new guzzle client
326 326
                     $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]);
327 327
                     // Submit the sitemap index to each search engine
328 328
                     try {
329 329
                         $guzzleClient->post($submissionUrl);
330 330
                         Craft::info(
331
-                            'Sitemap index submitted to: ' . $submissionUrl,
331
+                            'Sitemap index submitted to: '.$submissionUrl,
332 332
                             __METHOD__
333 333
                         );
334 334
                     } catch (\Exception $e) {
335 335
                         Craft::error(
336
-                            'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(),
336
+                            'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(),
337 337
                             __METHOD__
338 338
                         );
339 339
                     }
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
                     . '-'
375 375
                     . $metaBundle->sourceSiteId
376 376
                     . '-sitemap'
377
-                    . (!empty($page) ? '-p' . $page : '')
377
+                    . (!empty($page) ? '-p'.$page : '')
378 378
                     . '.xml',
379 379
                     null,
380 380
                     null,
@@ -403,19 +403,19 @@  discard block
 block discarded – undo
403 403
             foreach ($searchEngineUrls as &$url) {
404 404
                 $sitemapUrl = $this->sitemapCustomUrlForSiteId($siteId);
405 405
                 if (!empty($sitemapUrl)) {
406
-                    $submissionUrl = $url . urlencode($sitemapUrl);
406
+                    $submissionUrl = $url.urlencode($sitemapUrl);
407 407
                     // create new guzzle client
408 408
                     $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]);
409 409
                     // Submit the sitemap index to each search engine
410 410
                     try {
411 411
                         $guzzleClient->post($submissionUrl);
412 412
                         Craft::info(
413
-                            'Sitemap Custom submitted to: ' . $submissionUrl,
413
+                            'Sitemap Custom submitted to: '.$submissionUrl,
414 414
                             __METHOD__
415 415
                         );
416 416
                     } catch (\Exception $e) {
417 417
                         Craft::error(
418
-                            'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(),
418
+                            'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(),
419 419
                             __METHOD__
420 420
                         );
421 421
                     }
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
         }
494 494
 
495 495
         foreach ($sites as $site) {
496
-            $result .= 'sitemap: ' . $this->sitemapIndexUrlForSiteId($site->id) . PHP_EOL;
496
+            $result .= 'sitemap: '.$this->sitemapIndexUrlForSiteId($site->id).PHP_EOL;
497 497
         }
498 498
 
499 499
         return rtrim($result, PHP_EOL);
@@ -525,9 +525,9 @@  discard block
 block discarded – undo
525 525
         // Since we want a stale-while-revalidate pattern, only invalidate the cache if we're asked to
526 526
         if ($invalidateCache) {
527 527
             $cache = Craft::$app->getCache();
528
-            TagDependency::invalidate($cache, SitemapTemplate::SITEMAP_CACHE_TAG . $handle . $siteId);
528
+            TagDependency::invalidate($cache, SitemapTemplate::SITEMAP_CACHE_TAG.$handle.$siteId);
529 529
             Craft::info(
530
-                'Sitemap cache cleared: ' . $handle,
530
+                'Sitemap cache cleared: '.$handle,
531 531
                 __METHOD__
532 532
             );
533 533
         }
Please login to merge, or discard this patch.