@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | // Go from most specific type to least specific type |
| 95 | 95 | foreach (self::SCHEMA_TYPES as $schemaType) { |
| 96 | 96 | if (!empty($settings[$schemaType]) && ($settings[$schemaType] !== 'none')) { |
| 97 | - $result = $settings[$schemaType] . self::SCHEMA_PATH_DELIMITER . $result; |
|
| 97 | + $result = $settings[$schemaType].self::SCHEMA_PATH_DELIMITER.$result; |
|
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | if (isset($result['schemaTypeDescription'])) { |
| 127 | 127 | $description = $result['schemaTypeDescription']; |
| 128 | 128 | $description = preg_replace("`\[\[([A-z]*)\]\]`", '[$1](https://schema.org/$1)', $description); |
| 129 | - $description = Markdown::process((string)$description); |
|
| 129 | + $description = Markdown::process((string) $description); |
|
| 130 | 130 | $description = str_replace(['<p>', '</p>', '\n'], ['', '', ' '], $description); |
| 131 | 131 | $result['schemaTypeDescription'] = $description; |
| 132 | 132 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | { |
| 148 | 148 | $result = []; |
| 149 | 149 | while ($schemaType) { |
| 150 | - $className = 'nystudio107\\seomatic\\models\\jsonld\\' . $schemaType; |
|
| 150 | + $className = 'nystudio107\\seomatic\\models\\jsonld\\'.$schemaType; |
|
| 151 | 151 | if (class_exists($className)) { |
| 152 | 152 | try { |
| 153 | 153 | $classRef = new \ReflectionClass($className); |
@@ -254,15 +254,15 @@ discard block |
||
| 254 | 254 | $dependency = new TagDependency([ |
| 255 | 255 | 'tags' => [ |
| 256 | 256 | self::GLOBAL_SCHEMA_CACHE_TAG, |
| 257 | - self::SCHEMA_CACHE_TAG . 'schemaArray', |
|
| 257 | + self::SCHEMA_CACHE_TAG.'schemaArray', |
|
| 258 | 258 | ], |
| 259 | 259 | ]); |
| 260 | 260 | $cache = Craft::$app->getCache(); |
| 261 | 261 | $typesArray = $cache->getOrSet( |
| 262 | - self::CACHE_KEY . 'schemaArray', |
|
| 263 | - function () use ($path) { |
|
| 262 | + self::CACHE_KEY.'schemaArray', |
|
| 263 | + function() use ($path) { |
|
| 264 | 264 | Craft::info( |
| 265 | - 'schemaArray cache miss: ' . $path, |
|
| 265 | + 'schemaArray cache miss: '.$path, |
|
| 266 | 266 | __METHOD__ |
| 267 | 267 | ); |
| 268 | 268 | $filePath = Craft::getAlias('@nystudio107/seomatic/resources/schema/tree.jsonld'); |
@@ -355,13 +355,13 @@ discard block |
||
| 355 | 355 | $dependency = new TagDependency([ |
| 356 | 356 | 'tags' => [ |
| 357 | 357 | self::GLOBAL_SCHEMA_CACHE_TAG, |
| 358 | - self::SCHEMA_CACHE_TAG . 'schemaTree', |
|
| 358 | + self::SCHEMA_CACHE_TAG.'schemaTree', |
|
| 359 | 359 | ], |
| 360 | 360 | ]); |
| 361 | 361 | $cache = Craft::$app->getCache(); |
| 362 | 362 | $typesArray = $cache->getOrSet( |
| 363 | - self::CACHE_KEY . 'schemaArray', |
|
| 364 | - function () { |
|
| 363 | + self::CACHE_KEY.'schemaArray', |
|
| 364 | + function() { |
|
| 365 | 365 | Craft::info( |
| 366 | 366 | 'schemaTree cache miss', |
| 367 | 367 | __METHOD__ |
@@ -396,11 +396,11 @@ discard block |
||
| 396 | 396 | foreach ($typesArray as $key => $value) { |
| 397 | 397 | $indent = html_entity_decode(str_repeat(' ', $indentLevel)); |
| 398 | 398 | if (\is_array($value)) { |
| 399 | - $result[$key] = $indent . $key; |
|
| 399 | + $result[$key] = $indent.$key; |
|
| 400 | 400 | $value = self::flattenSchemaArray($value, $indentLevel + self::MENU_INDENT_STEP); |
| 401 | 401 | $result = array_merge($result, $value); |
| 402 | 402 | } else { |
| 403 | - $result[$key] = $indent . $value; |
|
| 403 | + $result[$key] = $indent.$value; |
|
| 404 | 404 | } |
| 405 | 405 | } |
| 406 | 406 | |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | $children = []; |
| 495 | 495 | $name = $typesArray['name']; |
| 496 | 496 | // Construct a path-based $id, excluding the top-level `Thing` schema |
| 497 | - $id = $name === 'Thing' ? '' : $path . self::SCHEMA_PATH_DELIMITER . $name; |
|
| 497 | + $id = $name === 'Thing' ? '' : $path.self::SCHEMA_PATH_DELIMITER.$name; |
|
| 498 | 498 | $id = ltrim($id, self::SCHEMA_PATH_DELIMITER); |
| 499 | 499 | // Make sure we have at most 3 specifiers in the schema path |
| 500 | 500 | $parts = explode(self::SCHEMA_PATH_DELIMITER, $id); |
@@ -521,12 +521,12 @@ discard block |
||
| 521 | 521 | $schemaPath = explode(self::SCHEMA_PATH_DELIMITER, $id); |
| 522 | 522 | // Use only the specific (last) type for now, rather than the complete path of types |
| 523 | 523 | $schemaPath = [end($schemaPath)]; |
| 524 | - if ((bool)array_intersect($schemaPath, array_keys($googleRichSnippetTypes))) { |
|
| 525 | - $name .= ' (' . Craft::t('seomatic', 'Google rich result') . ')'; |
|
| 524 | + if ((bool) array_intersect($schemaPath, array_keys($googleRichSnippetTypes))) { |
|
| 525 | + $name .= ' ('.Craft::t('seomatic', 'Google rich result').')'; |
|
| 526 | 526 | } |
| 527 | 527 | // Mark it as pending, if applicable |
| 528 | 528 | if (isset($typesArray['pending']) && $typesArray['pending']) { |
| 529 | - $name .= ' (' . Craft::t('seomatic', 'pending') . ')'; |
|
| 529 | + $name .= ' ('.Craft::t('seomatic', 'pending').')'; |
|
| 530 | 530 | } |
| 531 | 531 | $result['label'] = $name; |
| 532 | 532 | $result['id'] = $id; |
@@ -545,13 +545,13 @@ discard block |
||
| 545 | 545 | $dependency = new TagDependency([ |
| 546 | 546 | 'tags' => [ |
| 547 | 547 | self::GLOBAL_SCHEMA_CACHE_TAG, |
| 548 | - self::SCHEMA_CACHE_TAG . 'googleRichSnippets', |
|
| 548 | + self::SCHEMA_CACHE_TAG.'googleRichSnippets', |
|
| 549 | 549 | ], |
| 550 | 550 | ]); |
| 551 | 551 | $cache = Craft::$app->getCache(); |
| 552 | 552 | return $cache->getOrSet( |
| 553 | - self::CACHE_KEY . 'googleRichSnippets', |
|
| 554 | - function () { |
|
| 553 | + self::CACHE_KEY.'googleRichSnippets', |
|
| 554 | + function() { |
|
| 555 | 555 | Craft::info( |
| 556 | 556 | 'googleRichSnippets cache miss', |
| 557 | 557 | __METHOD__ |
@@ -270,7 +270,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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' => ' |
|