Passed
Push — develop ( ff37e3...53598d )
by Andrew
08:55
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   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
         self::$cacheDuration = self::$devMode
271 271
             ? self::DEVMODE_CACHE_DURATION
272 272
             : self::$settings->metaCacheDuration ?? null;
273
-        self::$cacheDuration = self::$cacheDuration === null ? null : (int)self::$cacheDuration;
273
+        self::$cacheDuration = self::$cacheDuration === null ? null : (int) self::$cacheDuration;
274 274
         self::$environment = EnvironmentHelper::determineEnvironment();
275 275
         MetaValueHelper::cache();
276 276
         // Version helpers
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
         Event::on(
346 346
             Plugins::class,
347 347
             Plugins::EVENT_AFTER_INSTALL_PLUGIN,
348
-            function (PluginEvent $event) {
348
+            function(PluginEvent $event) {
349 349
                 if ($event->plugin === $this) {
350 350
                     // Invalidate our caches after we've been installed
351 351
                     $this->clearAllCaches();
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
         Event::on(
367 367
             ClearCaches::class,
368 368
             ClearCaches::EVENT_REGISTER_CACHE_OPTIONS,
369
-            function (RegisterCacheOptionsEvent $event) {
369
+            function(RegisterCacheOptionsEvent $event) {
370 370
                 Craft::debug(
371 371
                     'ClearCaches::EVENT_REGISTER_CACHE_OPTIONS',
372 372
                     __METHOD__
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
         Event::on(
383 383
             Plugins::class,
384 384
             Plugins::EVENT_BEFORE_SAVE_PLUGIN_SETTINGS,
385
-            function (PluginEvent $event) {
385
+            function(PluginEvent $event) {
386 386
                 if ($event->plugin === $this && !Craft::$app->getDb()->getSupportsMb4()) {
387 387
                     // For all the emojis
388 388
                     $settingsModel = $this->getSettings();
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
         Event::on(
436 436
             Plugins::class,
437 437
             Plugins::EVENT_AFTER_LOAD_PLUGINS,
438
-            function () {
438
+            function() {
439 439
                 // Delay registering SEO Elements to give other plugins a chance to load first
440 440
                 $this->seoElements->getAllSeoElementTypes(false);
441 441
                 // Delay installing GQL handlers to give other plugins a chance to register their own first
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
         Event::on(
457 457
             Fields::class,
458 458
             Fields::EVENT_REGISTER_FIELD_TYPES,
459
-            function (RegisterComponentTypesEvent $event) {
459
+            function(RegisterComponentTypesEvent $event) {
460 460
                 $event->types[] = SeoSettingsField::class;
461 461
                 $event->types[] = Seomatic_MetaField::class;
462 462
             }
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
         Event::on(
466 466
             Elements::class,
467 467
             Elements::EVENT_AFTER_SAVE_ELEMENT,
468
-            function (ElementEvent $event) {
468
+            function(ElementEvent $event) {
469 469
                 Craft::debug(
470 470
                     'Elements::EVENT_AFTER_SAVE_ELEMENT',
471 471
                     __METHOD__
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
         Event::on(
486 486
             Elements::class,
487 487
             Elements::EVENT_AFTER_DELETE_ELEMENT,
488
-            function (ElementEvent $event) {
488
+            function(ElementEvent $event) {
489 489
                 Craft::debug(
490 490
                     'Elements::EVENT_AFTER_DELETE_ELEMENT',
491 491
                     __METHOD__
@@ -504,19 +504,19 @@  discard block
 block discarded – undo
504 504
             Event::on(
505 505
                 Entry::class,
506 506
                 Entry::EVENT_REGISTER_PREVIEW_TARGETS,
507
-                function (RegisterPreviewTargetsEvent $e) {
507
+                function(RegisterPreviewTargetsEvent $e) {
508 508
                     /** @var Element $element */
509 509
                     $element = $e->sender;
510 510
                     if ($element->uri !== null) {
511 511
                         $e->previewTargets[] = [
512
-                            'label' => '
Please login to merge, or discard this patch.