@@ -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__ |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | // Go from most specific type to least specific type |
100 | 100 | foreach (self::SCHEMA_TYPES as $schemaType) { |
101 | 101 | if (!empty($settings[$schemaType]) && ($settings[$schemaType] !== 'none')) { |
102 | - $result = $settings[$schemaType] . self::SCHEMA_PATH_DELIMITER . $result; |
|
102 | + $result = $settings[$schemaType].self::SCHEMA_PATH_DELIMITER.$result; |
|
103 | 103 | } |
104 | 104 | } |
105 | 105 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $description = $result['schemaTypeDescription']; |
126 | 126 | $description = preg_replace("`\[\[([A-z]*)\]\]`", '[$1](https://schema.org/$1)', $description); |
127 | 127 | $description = preg_replace('/\s+/', ' ', $description); |
128 | - $description = Markdown::process((string)$description); |
|
128 | + $description = Markdown::process((string) $description); |
|
129 | 129 | $description = str_replace(['<p>', '</p>', '\n'], ['', '', ' '], $description); |
130 | 130 | $result['schemaTypeDescription'] = $description; |
131 | 131 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | { |
145 | 145 | $result = []; |
146 | 146 | while ($schemaType) { |
147 | - $className = 'nystudio107\\seomatic\\models\\jsonld\\' . $schemaType; |
|
147 | + $className = 'nystudio107\\seomatic\\models\\jsonld\\'.$schemaType; |
|
148 | 148 | if (class_exists($className)) { |
149 | 149 | $classRef = new ReflectionClass($className); |
150 | 150 | $staticProps = $classRef->getStaticProperties(); |
@@ -243,15 +243,15 @@ discard block |
||
243 | 243 | $dependency = new TagDependency([ |
244 | 244 | 'tags' => [ |
245 | 245 | self::GLOBAL_SCHEMA_CACHE_TAG, |
246 | - self::SCHEMA_CACHE_TAG . 'schemaArray', |
|
246 | + self::SCHEMA_CACHE_TAG.'schemaArray', |
|
247 | 247 | ], |
248 | 248 | ]); |
249 | 249 | $cache = Craft::$app->getCache(); |
250 | 250 | $typesArray = $cache->getOrSet( |
251 | - self::CACHE_KEY . 'schemaArray', |
|
251 | + self::CACHE_KEY.'schemaArray', |
|
252 | 252 | function() use ($path) { |
253 | 253 | Craft::info( |
254 | - 'schemaArray cache miss: ' . $path, |
|
254 | + 'schemaArray cache miss: '.$path, |
|
255 | 255 | __METHOD__ |
256 | 256 | ); |
257 | 257 | $filePath = Craft::getAlias('@nystudio107/seomatic/resources/schema/tree.jsonld'); |
@@ -316,12 +316,12 @@ discard block |
||
316 | 316 | $dependency = new TagDependency([ |
317 | 317 | 'tags' => [ |
318 | 318 | self::GLOBAL_SCHEMA_CACHE_TAG, |
319 | - self::SCHEMA_CACHE_TAG . 'schemaTree', |
|
319 | + self::SCHEMA_CACHE_TAG.'schemaTree', |
|
320 | 320 | ], |
321 | 321 | ]); |
322 | 322 | $cache = Craft::$app->getCache(); |
323 | 323 | $typesArray = $cache->getOrSet( |
324 | - self::CACHE_KEY . 'schemaTree', |
|
324 | + self::CACHE_KEY.'schemaTree', |
|
325 | 325 | function() { |
326 | 326 | Craft::info( |
327 | 327 | 'schemaTree cache miss', |
@@ -385,11 +385,11 @@ discard block |
||
385 | 385 | foreach ($typesArray as $key => $value) { |
386 | 386 | $indent = html_entity_decode(str_repeat(' ', $indentLevel)); |
387 | 387 | if (is_array($value)) { |
388 | - $result[$key] = $indent . $key; |
|
388 | + $result[$key] = $indent.$key; |
|
389 | 389 | $value = self::flattenSchemaArray($value, $indentLevel + self::MENU_INDENT_STEP); |
390 | 390 | $result = array_merge($result, $value); |
391 | 391 | } else { |
392 | - $result[$key] = $indent . $value; |
|
392 | + $result[$key] = $indent.$value; |
|
393 | 393 | } |
394 | 394 | } |
395 | 395 | |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | $children = []; |
484 | 484 | $name = $typesArray['name']; |
485 | 485 | // Construct a path-based $id, excluding the top-level `Thing` schema |
486 | - $id = $name === 'Thing' ? '' : $path . self::SCHEMA_PATH_DELIMITER . $name; |
|
486 | + $id = $name === 'Thing' ? '' : $path.self::SCHEMA_PATH_DELIMITER.$name; |
|
487 | 487 | $id = ltrim($id, self::SCHEMA_PATH_DELIMITER); |
488 | 488 | // Make sure we have at most 3 specifiers in the schema path |
489 | 489 | $parts = explode(self::SCHEMA_PATH_DELIMITER, $id); |
@@ -510,12 +510,12 @@ discard block |
||
510 | 510 | $schemaPath = explode(self::SCHEMA_PATH_DELIMITER, $id); |
511 | 511 | // Use only the specific (last) type for now, rather than the complete path of types |
512 | 512 | $schemaPath = [end($schemaPath)]; |
513 | - if ((bool)array_intersect($schemaPath, array_keys($googleRichSnippetTypes))) { |
|
514 | - $name .= ' (' . Craft::t('seomatic', 'Google rich result') . ')'; |
|
513 | + if ((bool) array_intersect($schemaPath, array_keys($googleRichSnippetTypes))) { |
|
514 | + $name .= ' ('.Craft::t('seomatic', 'Google rich result').')'; |
|
515 | 515 | } |
516 | 516 | // Mark it as pending, if applicable |
517 | 517 | if (isset($typesArray['pending']) && $typesArray['pending']) { |
518 | - $name .= ' (' . Craft::t('seomatic', 'pending') . ')'; |
|
518 | + $name .= ' ('.Craft::t('seomatic', 'pending').')'; |
|
519 | 519 | } |
520 | 520 | $result['label'] = $name; |
521 | 521 | $result['id'] = $id; |
@@ -534,12 +534,12 @@ discard block |
||
534 | 534 | $dependency = new TagDependency([ |
535 | 535 | 'tags' => [ |
536 | 536 | self::GLOBAL_SCHEMA_CACHE_TAG, |
537 | - self::SCHEMA_CACHE_TAG . 'googleRichSnippets', |
|
537 | + self::SCHEMA_CACHE_TAG.'googleRichSnippets', |
|
538 | 538 | ], |
539 | 539 | ]); |
540 | 540 | $cache = Craft::$app->getCache(); |
541 | 541 | return $cache->getOrSet( |
542 | - self::CACHE_KEY . 'googleRichSnippets', |
|
542 | + self::CACHE_KEY.'googleRichSnippets', |
|
543 | 543 | function() { |
544 | 544 | Craft::info( |
545 | 545 | 'googleRichSnippets cache miss', |