Passed
Push — develop-v4 ( 7fca76...871448 )
by Andrew
18:23 queued 08:56
created
src/helpers/Schema.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             // Go from most specific type to least specific type
94 94
             foreach (self::SCHEMA_TYPES as $schemaType) {
95 95
                 if (!empty($settings[$schemaType]) && ($settings[$schemaType] !== 'none')) {
96
-                    $result = $settings[$schemaType] . self::SCHEMA_PATH_DELIMITER . $result;
96
+                    $result = $settings[$schemaType].self::SCHEMA_PATH_DELIMITER.$result;
97 97
                 }
98 98
             }
99 99
         }
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     {
140 140
         $result = [];
141 141
         while ($schemaType) {
142
-            $className = 'nystudio107\\seomatic\\models\\jsonld\\' . $schemaType;
142
+            $className = 'nystudio107\\seomatic\\models\\jsonld\\'.$schemaType;
143 143
             if (class_exists($className)) {
144 144
                 try {
145 145
                     $classRef = new \ReflectionClass($className);
@@ -246,15 +246,15 @@  discard block
 block discarded – undo
246 246
         $dependency = new TagDependency([
247 247
             'tags' => [
248 248
                 self::GLOBAL_SCHEMA_CACHE_TAG,
249
-                self::SCHEMA_CACHE_TAG . 'schemaArray',
249
+                self::SCHEMA_CACHE_TAG.'schemaArray',
250 250
             ],
251 251
         ]);
252 252
         $cache = Craft::$app->getCache();
253 253
         $typesArray = $cache->getOrSet(
254
-            self::CACHE_KEY . 'schemaArray',
255
-            function () use ($path) {
254
+            self::CACHE_KEY.'schemaArray',
255
+            function() use ($path) {
256 256
                 Craft::info(
257
-                    'schemaArray cache miss' . $path,
257
+                    'schemaArray cache miss'.$path,
258 258
                     __METHOD__
259 259
                 );
260 260
                 $filePath = Craft::getAlias('@nystudio107/seomatic/resources/schema/tree.jsonld');
@@ -295,13 +295,13 @@  discard block
 block discarded – undo
295 295
         $dependency = new TagDependency([
296 296
             'tags' => [
297 297
                 self::GLOBAL_SCHEMA_CACHE_TAG,
298
-                self::SCHEMA_CACHE_TAG . 'schemaTree',
298
+                self::SCHEMA_CACHE_TAG.'schemaTree',
299 299
             ],
300 300
         ]);
301 301
         $cache = Craft::$app->getCache();
302 302
         $typesArray = $cache->getOrSet(
303
-            self::CACHE_KEY . 'schemaArray',
304
-            function () {
303
+            self::CACHE_KEY.'schemaArray',
304
+            function() {
305 305
                 Craft::info(
306 306
                     'schemaTree cache miss',
307 307
                     __METHOD__
@@ -336,11 +336,11 @@  discard block
 block discarded – undo
336 336
         foreach ($typesArray as $key => $value) {
337 337
             $indent = html_entity_decode(str_repeat(' ', $indentLevel));
338 338
             if (\is_array($value)) {
339
-                $result[$key] = $indent . $key;
339
+                $result[$key] = $indent.$key;
340 340
                 $value = self::flattenSchemaArray($value, $indentLevel + self::MENU_INDENT_STEP);
341 341
                 $result = array_merge($result, $value);
342 342
             } else {
343
-                $result[$key] = $indent . $value;
343
+                $result[$key] = $indent.$value;
344 344
             }
345 345
         }
346 346
 
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
             $children = [];
435 435
             $name = $typesArray['name'];
436 436
             // Construct a path-based $id, excluding the top-level `Thing` schema
437
-            $id = $name === 'Thing' ? '' : $path . self::SCHEMA_PATH_DELIMITER . $name;
437
+            $id = $name === 'Thing' ? '' : $path.self::SCHEMA_PATH_DELIMITER.$name;
438 438
             $id = ltrim($id, self::SCHEMA_PATH_DELIMITER);
439 439
             // Make sure we have at most 3 specifiers in the schema path
440 440
             $parts = explode(self::SCHEMA_PATH_DELIMITER, $id);
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
                 $schemaPath = explode(self::SCHEMA_PATH_DELIMITER, $id);
466 466
                 // Use only the specific (last) type for now, rather than the complete path of types
467 467
                 $schemaPath = [end($schemaPath)];
468
-                if ((bool)array_intersect($schemaPath, array_keys($googleRichSnippetTypes))) {
468
+                if ((bool) array_intersect($schemaPath, array_keys($googleRichSnippetTypes))) {
469 469
                     $name .= ' (Google rich snippet)';
470 470
                 }
471 471
             }
@@ -486,13 +486,13 @@  discard block
 block discarded – undo
486 486
         $dependency = new TagDependency([
487 487
             'tags' => [
488 488
                 self::GLOBAL_SCHEMA_CACHE_TAG,
489
-                self::SCHEMA_CACHE_TAG . 'googleRichSnippets',
489
+                self::SCHEMA_CACHE_TAG.'googleRichSnippets',
490 490
             ],
491 491
         ]);
492 492
         $cache = Craft::$app->getCache();
493 493
         return $cache->getOrSet(
494
-            self::CACHE_KEY . 'googleRichSnippets',
495
-            function () {
494
+            self::CACHE_KEY.'googleRichSnippets',
495
+            function() {
496 496
                 Craft::info(
497 497
                     'googleRichSnippets cache miss',
498 498
                     __METHOD__
Please login to merge, or discard this patch.
src/Seomatic.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
             $lastSegment = end($segments);
344 344
             $site = Craft::$app->getSites()->getSiteByHandle($lastSegment);
345 345
             if ($site !== null) {
346
-                $siteSuffix = '/' . $lastSegment;
346
+                $siteSuffix = '/'.$lastSegment;
347 347
             }
348 348
         }
349 349
         $currentUser = Craft::$app->getUser()->getIdentity();
@@ -351,31 +351,31 @@  discard block
 block discarded – undo
351 351
         if ($currentUser->can('seomatic:dashboard')) {
352 352
             $subNavs['dashboard'] = [
353 353
                 'label' => Craft::t('seomatic', 'Dashboard'),
354
-                'url' => 'seomatic/dashboard' . $siteSuffix,
354
+                'url' => 'seomatic/dashboard'.$siteSuffix,
355 355
             ];
356 356
         }
357 357
         if ($currentUser->can('seomatic:global-meta')) {
358 358
             $subNavs['global'] = [
359 359
                 'label' => Craft::t('seomatic', 'Global SEO'),
360
-                'url' => 'seomatic/global/general' . $siteSuffix,
360
+                'url' => 'seomatic/global/general'.$siteSuffix,
361 361
             ];
362 362
         }
363 363
         if ($currentUser->can('seomatic:content-meta')) {
364 364
             $subNavs['content'] = [
365 365
                 'label' => Craft::t('seomatic', 'Content SEO'),
366
-                'url' => 'seomatic/content' . $siteSuffix,
366
+                'url' => 'seomatic/content'.$siteSuffix,
367 367
             ];
368 368
         }
369 369
         if ($currentUser->can('seomatic:site-settings')) {
370 370
             $subNavs['site'] = [
371 371
                 'label' => Craft::t('seomatic', 'Site Settings'),
372
-                'url' => 'seomatic/site/identity' . $siteSuffix,
372
+                'url' => 'seomatic/site/identity'.$siteSuffix,
373 373
             ];
374 374
         }
375 375
         if ($currentUser->can('seomatic:tracking-scripts')) {
376 376
             $subNavs['tracking'] = [
377 377
                 'label' => Craft::t('seomatic', 'Tracking Scripts'),
378
-                'url' => 'seomatic/tracking/gtag' . $siteSuffix,
378
+                'url' => 'seomatic/tracking/gtag'.$siteSuffix,
379 379
             ];
380 380
         }
381 381
         $editableSettings = true;
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
         Event::on(
421 421
             Plugins::class,
422 422
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
423
-            function (PluginEvent $event) {
423
+            function(PluginEvent $event) {
424 424
                 if ($event->plugin === $this) {
425 425
                     // Invalidate our caches after we've been installed
426 426
                     $this->clearAllCaches();
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
         Event::on(
442 442
             ClearCaches::class,
443 443
             ClearCaches::EVENT_REGISTER_CACHE_OPTIONS,
444
-            function (RegisterCacheOptionsEvent $event) {
444
+            function(RegisterCacheOptionsEvent $event) {
445 445
                 Craft::debug(
446 446
                     'ClearCaches::EVENT_REGISTER_CACHE_OPTIONS',
447 447
                     __METHOD__
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
         Event::on(
458 458
             Plugins::class,
459 459
             Plugins::EVENT_BEFORE_SAVE_PLUGIN_SETTINGS,
460
-            function (PluginEvent $event) {
460
+            function(PluginEvent $event) {
461 461
                 if ($event->plugin === $this && !Craft::$app->getDb()->getSupportsMb4()) {
462 462
                     // For all the emojis
463 463
                     $settingsModel = $this->getSettings();
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
         Event::on(
488 488
             Plugins::class,
489 489
             Plugins::EVENT_AFTER_LOAD_PLUGINS,
490
-            function () {
490
+            function() {
491 491
                 // Delay registering SEO Elements to give other plugins a chance to load first
492 492
                 $this->seoElements->getAllSeoElementTypes(false);
493 493
                 // Delay installing GQL handlers to give other plugins a chance to register their own first
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
         Event::on(
509 509
             Fields::class,
510 510
             Fields::EVENT_REGISTER_FIELD_TYPES,
511
-            static function (RegisterComponentTypesEvent $event) {
511
+            static function(RegisterComponentTypesEvent $event) {
512 512
                 $event->types[] = SeoSettingsField::class;
513 513
                 $event->types[] = Seomatic_MetaField::class;
514 514
             }
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
         Event::on(
518 518
             Elements::class,
519 519
             Elements::EVENT_AFTER_SAVE_ELEMENT,
520
-            static function (ElementEvent $event) {
520
+            static function(ElementEvent $event) {
521 521
                 Craft::debug(
522 522
                     'Elements::EVENT_AFTER_SAVE_ELEMENT',
523 523
                     __METHOD__
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
         Event::on(
538 538
             Elements::class,
539 539
             Elements::EVENT_AFTER_DELETE_ELEMENT,
540
-            static function (ElementEvent $event) {
540
+            static function(ElementEvent $event) {
541 541
                 Craft::debug(
542 542
                     'Elements::EVENT_AFTER_DELETE_ELEMENT',
543 543
                     __METHOD__
@@ -556,19 +556,19 @@  discard block
 block discarded – undo
556 556
             Event::on(
557 557
                 Entry::class,
558 558
                 Element::EVENT_REGISTER_PREVIEW_TARGETS,
559
-                static function (RegisterPreviewTargetsEvent $e) {
559
+                static function(RegisterPreviewTargetsEvent $e) {
560 560
                     /** @var Element $element */
561 561
                     $element = $e->sender;
562 562
                     if ($element->uri !== null) {
563 563
                         $e->previewTargets[] = [
564
-                            'label' => '
Please login to merge, or discard this patch.