@@ -127,18 +127,18 @@ discard block |
||
127 | 127 | $dependency = new TagDependency([ |
128 | 128 | 'tags' => [ |
129 | 129 | self::GLOBAL_SITEMAP_CACHE_TAG, |
130 | - self::SITEMAP_CACHE_TAG . $handle . $siteId, |
|
130 | + self::SITEMAP_CACHE_TAG.$handle.$siteId, |
|
131 | 131 | ], |
132 | 132 | ]); |
133 | 133 | |
134 | 134 | $cacheDuration = Seomatic::$plugin->helper::isPreview() ? 1 : Seomatic::$cacheDuration; |
135 | 135 | |
136 | - return $cache->getOrSet(self::CACHE_KEY . $groupId . self::CUSTOM_SCOPE . $handle . $siteId, function() use ( |
|
136 | + return $cache->getOrSet(self::CACHE_KEY.$groupId.self::CUSTOM_SCOPE.$handle.$siteId, function() use ( |
|
137 | 137 | $handle, |
138 | 138 | $siteId |
139 | 139 | ) { |
140 | 140 | Craft::info( |
141 | - 'Sitemap Custom cache miss: ' . $handle . '/' . $siteId, |
|
141 | + 'Sitemap Custom cache miss: '.$handle.'/'.$siteId, |
|
142 | 142 | __METHOD__ |
143 | 143 | ); |
144 | 144 | $lines = []; |
@@ -211,9 +211,9 @@ discard block |
||
211 | 211 | { |
212 | 212 | $handle = self::CUSTOM_HANDLE; |
213 | 213 | $cache = Craft::$app->getCache(); |
214 | - TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG . $handle . $siteId); |
|
214 | + TagDependency::invalidate($cache, self::SITEMAP_CACHE_TAG.$handle.$siteId); |
|
215 | 215 | Craft::info( |
216 | - 'Sitemap Custom cache cleared: ' . $handle, |
|
216 | + 'Sitemap Custom cache cleared: '.$handle, |
|
217 | 217 | __METHOD__ |
218 | 218 | ); |
219 | 219 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function getFilename(int $groupId): string |
119 | 119 | { |
120 | - return 'sitemaps-' . $groupId . '-sitemap.xml'; |
|
120 | + return 'sitemaps-'.$groupId.'-sitemap.xml'; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | $cacheDuration = Seomatic::$plugin->helper::isPreview() ? 1 : Seomatic::$cacheDuration; |
153 | 153 | |
154 | - return $cache->getOrSet(self::CACHE_KEY . $groupId . '.' . $siteId, function() use ($groupSiteIds, $siteId) { |
|
154 | + return $cache->getOrSet(self::CACHE_KEY.$groupId.'.'.$siteId, function() use ($groupSiteIds, $siteId) { |
|
155 | 155 | Craft::info( |
156 | 156 | 'Sitemap index cache miss', |
157 | 157 | __METHOD__ |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | // Go from most specific type to least specific type |
101 | 101 | foreach (self::SCHEMA_TYPES as $schemaType) { |
102 | 102 | if (!empty($settings[$schemaType]) && ($settings[$schemaType] !== 'none')) { |
103 | - $result = $settings[$schemaType] . self::SCHEMA_PATH_DELIMITER . $result; |
|
103 | + $result = $settings[$schemaType].self::SCHEMA_PATH_DELIMITER.$result; |
|
104 | 104 | } |
105 | 105 | } |
106 | 106 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $description = $result['schemaTypeDescription']; |
133 | 133 | $description = preg_replace("`\[\[([A-z]*)\]\]`", '[$1](https://schema.org/$1)', $description); |
134 | 134 | $description = preg_replace('/\s+/', ' ', $description); |
135 | - $description = Markdown::process((string)$description); |
|
135 | + $description = Markdown::process((string) $description); |
|
136 | 136 | $description = str_replace(['<p>', '</p>', '\n'], ['', '', ' '], $description); |
137 | 137 | $result['schemaTypeDescription'] = $description; |
138 | 138 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | { |
153 | 153 | $result = []; |
154 | 154 | while ($schemaType) { |
155 | - $className = 'nystudio107\\seomatic\\models\\jsonld\\' . $schemaType; |
|
155 | + $className = 'nystudio107\\seomatic\\models\\jsonld\\'.$schemaType; |
|
156 | 156 | if (class_exists($className)) { |
157 | 157 | $classRef = new ReflectionClass($className); |
158 | 158 | $staticProps = $classRef->getStaticProperties(); |
@@ -249,15 +249,15 @@ discard block |
||
249 | 249 | $dependency = new TagDependency([ |
250 | 250 | 'tags' => [ |
251 | 251 | self::GLOBAL_SCHEMA_CACHE_TAG, |
252 | - self::SCHEMA_CACHE_TAG . 'schemaArray', |
|
252 | + self::SCHEMA_CACHE_TAG.'schemaArray', |
|
253 | 253 | ], |
254 | 254 | ]); |
255 | 255 | $cache = Craft::$app->getCache(); |
256 | 256 | $typesArray = $cache->getOrSet( |
257 | - self::CACHE_KEY . 'schemaArray', |
|
257 | + self::CACHE_KEY.'schemaArray', |
|
258 | 258 | function() use ($path) { |
259 | 259 | Craft::info( |
260 | - 'schemaArray cache miss' . $path, |
|
260 | + 'schemaArray cache miss'.$path, |
|
261 | 261 | __METHOD__ |
262 | 262 | ); |
263 | 263 | $filePath = Craft::getAlias('@nystudio107/seomatic/resources/schema/tree.jsonld'); |
@@ -322,12 +322,12 @@ discard block |
||
322 | 322 | $dependency = new TagDependency([ |
323 | 323 | 'tags' => [ |
324 | 324 | self::GLOBAL_SCHEMA_CACHE_TAG, |
325 | - self::SCHEMA_CACHE_TAG . 'schemaTree', |
|
325 | + self::SCHEMA_CACHE_TAG.'schemaTree', |
|
326 | 326 | ], |
327 | 327 | ]); |
328 | 328 | $cache = Craft::$app->getCache(); |
329 | 329 | $typesArray = $cache->getOrSet( |
330 | - self::CACHE_KEY . 'schemaTree', |
|
330 | + self::CACHE_KEY.'schemaTree', |
|
331 | 331 | function() { |
332 | 332 | Craft::info( |
333 | 333 | 'schemaArray cache miss', |
@@ -391,11 +391,11 @@ discard block |
||
391 | 391 | foreach ($typesArray as $key => $value) { |
392 | 392 | $indent = html_entity_decode(str_repeat(' ', $indentLevel)); |
393 | 393 | if (is_array($value)) { |
394 | - $result[$key] = $indent . $key; |
|
394 | + $result[$key] = $indent.$key; |
|
395 | 395 | $value = self::flattenSchemaArray($value, $indentLevel + self::MENU_INDENT_STEP); |
396 | 396 | $result = array_merge($result, $value); |
397 | 397 | } else { |
398 | - $result[$key] = $indent . $value; |
|
398 | + $result[$key] = $indent.$value; |
|
399 | 399 | } |
400 | 400 | } |
401 | 401 | |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | $children = []; |
490 | 490 | $name = $typesArray['name']; |
491 | 491 | // Construct a path-based $id, excluding the top-level `Thing` schema |
492 | - $id = $name === 'Thing' ? '' : $path . self::SCHEMA_PATH_DELIMITER . $name; |
|
492 | + $id = $name === 'Thing' ? '' : $path.self::SCHEMA_PATH_DELIMITER.$name; |
|
493 | 493 | $id = ltrim($id, self::SCHEMA_PATH_DELIMITER); |
494 | 494 | // Make sure we have at most 3 specifiers in the schema path |
495 | 495 | $parts = explode(self::SCHEMA_PATH_DELIMITER, $id); |
@@ -516,12 +516,12 @@ discard block |
||
516 | 516 | $schemaPath = explode(self::SCHEMA_PATH_DELIMITER, $id); |
517 | 517 | // Use only the specific (last) type for now, rather than the complete path of types |
518 | 518 | $schemaPath = [end($schemaPath)]; |
519 | - if ((bool)array_intersect($schemaPath, array_keys($googleRichSnippetTypes))) { |
|
520 | - $name .= ' (' . Craft::t('seomatic', 'Google rich result') . ')'; |
|
519 | + if ((bool) array_intersect($schemaPath, array_keys($googleRichSnippetTypes))) { |
|
520 | + $name .= ' ('.Craft::t('seomatic', 'Google rich result').')'; |
|
521 | 521 | } |
522 | 522 | // Mark it as pending, if applicable |
523 | 523 | if (isset($typesArray['pending']) && $typesArray['pending']) { |
524 | - $name .= ' (' . Craft::t('seomatic', 'pending') . ')'; |
|
524 | + $name .= ' ('.Craft::t('seomatic', 'pending').')'; |
|
525 | 525 | } |
526 | 526 | $result['label'] = $name; |
527 | 527 | $result['id'] = $id; |
@@ -540,12 +540,12 @@ discard block |
||
540 | 540 | $dependency = new TagDependency([ |
541 | 541 | 'tags' => [ |
542 | 542 | self::GLOBAL_SCHEMA_CACHE_TAG, |
543 | - self::SCHEMA_CACHE_TAG . 'googleRichSnippets', |
|
543 | + self::SCHEMA_CACHE_TAG.'googleRichSnippets', |
|
544 | 544 | ], |
545 | 545 | ]); |
546 | 546 | $cache = Craft::$app->getCache(); |
547 | 547 | return $cache->getOrSet( |
548 | - self::CACHE_KEY . 'googleRichSnippets', |
|
548 | + self::CACHE_KEY.'googleRichSnippets', |
|
549 | 549 | function() { |
550 | 550 | Craft::info( |
551 | 551 | 'googleRichSnippets cache miss', |