@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | /** |
161 | 161 | * @inheritdoc |
162 | 162 | */ |
163 | - public function getContentColumnType(): array|string |
|
163 | + public function getContentColumnType(): array | string |
|
164 | 164 | { |
165 | 165 | return Schema::TYPE_TEXT; |
166 | 166 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | } |
232 | 232 | // Handle the mainEntityOfPage |
233 | 233 | $mainEntity = ''; |
234 | - if (in_array('mainEntityOfPage', (array)$this->generalEnabledFields, false) && |
|
234 | + if (in_array('mainEntityOfPage', (array) $this->generalEnabledFields, false) && |
|
235 | 235 | !empty($config['metaBundleSettings'])) { |
236 | 236 | $mainEntity = SchemaHelper::getSpecificEntityType($config['metaBundleSettings'], true); |
237 | 237 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | $value = StringHelper::encodeMb4($value); |
262 | 262 | } |
263 | 263 | if (is_array($value)) { |
264 | - array_walk_recursive($value, function (&$arrayValue, $arrayKey) { |
|
264 | + array_walk_recursive($value, function(&$arrayValue, $arrayKey) { |
|
265 | 265 | if ($arrayValue !== null && is_string($arrayValue)) { |
266 | 266 | $arrayValue = StringHelper::encodeMb4($arrayValue); |
267 | 267 | } |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | if ($element !== null && $element->uri !== null) { |
398 | 398 | $siteId = $element->siteId; |
399 | 399 | $uri = $element->uri; |
400 | - $cacheKey = self::CACHE_KEY . $uri . $siteId . $this->elementDisplayPreviewType; |
|
400 | + $cacheKey = self::CACHE_KEY.$uri.$siteId.$this->elementDisplayPreviewType; |
|
401 | 401 | $metaBundleSourceType = Seomatic::$plugin->seoElements->getMetaBundleTypeFromElement($element); |
402 | 402 | $seoElement = Seomatic::$plugin->seoElements->getSeoElementByMetaBundleType($metaBundleSourceType); |
403 | 403 | $metaBundleSourceType = SeoEntry::getMetaBundleType(); |
@@ -408,15 +408,15 @@ discard block |
||
408 | 408 | $dependency = new TagDependency([ |
409 | 409 | 'tags' => [ |
410 | 410 | MetaContainers::GLOBAL_METACONTAINER_CACHE_TAG, |
411 | - MetaContainers::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId, |
|
412 | - MetaContainers::METACONTAINER_CACHE_TAG . $uri . $siteId, |
|
411 | + MetaContainers::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId, |
|
412 | + MetaContainers::METACONTAINER_CACHE_TAG.$uri.$siteId, |
|
413 | 413 | ], |
414 | 414 | ]); |
415 | 415 | $cache = Craft::$app->getCache(); |
416 | 416 | $cacheDuration = null; |
417 | 417 | $html = $cache->getOrSet( |
418 | - self::CACHE_KEY . $cacheKey, |
|
419 | - function () use ($uri, $siteId, $element) { |
|
418 | + self::CACHE_KEY.$cacheKey, |
|
419 | + function() use ($uri, $siteId, $element) { |
|
420 | 420 | Seomatic::$plugin->metaContainers->previewMetaContainers($uri, $siteId, true); |
421 | 421 | $variables = [ |
422 | 422 | 'previewTypes' => [ |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | ) |
459 | 459 | { |
460 | 460 | $variables['textFieldSources'] = array_merge( |
461 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'], |
|
461 | + ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'], |
|
462 | 462 | FieldHelper::fieldsOfTypeFromElement( |
463 | 463 | $element, |
464 | 464 | FieldHelper::TEXT_FIELD_CLASS_KEY, |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | ) |
467 | 467 | ); |
468 | 468 | $variables['assetFieldSources'] = array_merge( |
469 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields']], |
|
469 | + ['entryGroup' => ['optgroup' => $groupName.' Fields']], |
|
470 | 470 | FieldHelper::fieldsOfTypeFromElement( |
471 | 471 | $element, |
472 | 472 | FieldHelper::ASSET_FIELD_CLASS_KEY, |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | // Output some info if this is a console app |
81 | 81 | if ($job && Craft::$app instanceof ConsoleApplication) { |
82 | - echo $job->description . PHP_EOL; |
|
82 | + echo $job->description.PHP_EOL; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | $lines = []; |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | while ($currentElement < $totalElements) { |
140 | 140 | $elements = $paginator->getPageResults(); |
141 | 141 | if (Craft::$app instanceof ConsoleApplication) { |
142 | - echo 'Query ' . $paginator->getCurrentPage() . '/' . $paginator->getTotalPages() |
|
143 | - . ' - elements: ' . $paginator->getTotalResults() |
|
142 | + echo 'Query '.$paginator->getCurrentPage().'/'.$paginator->getTotalPages() |
|
143 | + . ' - elements: '.$paginator->getTotalResults() |
|
144 | 144 | . PHP_EOL; |
145 | 145 | } |
146 | 146 | /** @var ElementInterface $element */ |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | } |
153 | 153 | // Output some info if this is a console app |
154 | 154 | if (Craft::$app instanceof ConsoleApplication) { |
155 | - echo "Processing element {$currentElement}/{$totalElements} - {$element->title}" . PHP_EOL; |
|
155 | + echo "Processing element {$currentElement}/{$totalElements} - {$element->title}".PHP_EOL; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | $metaBundle->metaSitemapVars->setAttributes($stashedSitemapAttrs, false); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | } |
190 | 190 | $canonicalUrl = UrlHelper::absoluteUrlWithProtocol($canonicalUrl); |
191 | 191 | if ($url !== $canonicalUrl) { |
192 | - Craft::info("Excluding URL: {$url} from the sitemap because it does not match the Canonical URL: {$canonicalUrl} - " . $metaBundle->metaGlobalVars->canonicalUrl . " - " . $element->uri); |
|
192 | + Craft::info("Excluding URL: {$url} from the sitemap because it does not match the Canonical URL: {$canonicalUrl} - ".$metaBundle->metaGlobalVars->canonicalUrl." - ".$element->uri); |
|
193 | 193 | continue; |
194 | 194 | } |
195 | 195 | } |
@@ -241,12 +241,12 @@ discard block |
||
241 | 241 | if ($primarySiteId === $altSourceSiteId && Seomatic::$settings->addXDefaultHrefLang) { |
242 | 242 | $lines[] = '<xhtml:link rel="alternate"' |
243 | 243 | . ' hreflang="x-default"' |
244 | - . ' href="' . Html::encode($altUrl) . '"' |
|
244 | + . ' href="'.Html::encode($altUrl).'"' |
|
245 | 245 | . ' />'; |
246 | 246 | } |
247 | 247 | $lines[] = '<xhtml:link rel="alternate"' |
248 | - . ' hreflang="' . $altSiteSettings['language'] . '"' |
|
249 | - . ' href="' . Html::encode($altUrl) . '"' |
|
248 | + . ' hreflang="'.$altSiteSettings['language'].'"' |
|
249 | + . ' href="'.Html::encode($altUrl).'"' |
|
250 | 250 | . ' />'; |
251 | 251 | } |
252 | 252 | } |
@@ -346,11 +346,11 @@ discard block |
||
346 | 346 | } |
347 | 347 | |
348 | 348 | $cache = Craft::$app->getCache(); |
349 | - $cacheKey = SitemapTemplate::CACHE_KEY . $groupId . $type . $handle . $siteId; |
|
349 | + $cacheKey = SitemapTemplate::CACHE_KEY.$groupId.$type.$handle.$siteId; |
|
350 | 350 | $dependency = new TagDependency([ |
351 | 351 | 'tags' => [ |
352 | 352 | SitemapTemplate::GLOBAL_SITEMAP_CACHE_TAG, |
353 | - SitemapTemplate::SITEMAP_CACHE_TAG . $handle . $siteId, |
|
353 | + SitemapTemplate::SITEMAP_CACHE_TAG.$handle.$siteId, |
|
354 | 354 | ], |
355 | 355 | ]); |
356 | 356 | $lines = implode('', $lines); |
@@ -363,10 +363,10 @@ discard block |
||
363 | 363 | $result = $cache->set($cacheKey, $lines, $cacheDuration, $dependency); |
364 | 364 | // Remove the queue job id from the cache too |
365 | 365 | $cache->delete($queueJobCacheKey); |
366 | - Craft::debug('Sitemap cache result: ' . print_r($result, true) . ' for cache key: ' . $cacheKey, __METHOD__); |
|
366 | + Craft::debug('Sitemap cache result: '.print_r($result, true).' for cache key: '.$cacheKey, __METHOD__); |
|
367 | 367 | // Output some info if this is a console app |
368 | 368 | if (Craft::$app instanceof ConsoleApplication) { |
369 | - echo 'Sitemap cache result: ' . print_r($result, true) . ' for cache key: ' . $cacheKey . PHP_EOL; |
|
369 | + echo 'Sitemap cache result: '.print_r($result, true).' for cache key: '.$cacheKey.PHP_EOL; |
|
370 | 370 | } |
371 | 371 | // If the FastCGI Cache Bust plugin is installed, clear its caches too |
372 | 372 | $plugin = Craft::$app->getPlugins()->getPlugin('fastcgi-cache-bust'); |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | |
447 | 447 | $attributes = \array_intersect_key( |
448 | 448 | $attributes, |
449 | - array_flip((array)$seoSettingsField->sitemapEnabledFields) |
|
449 | + array_flip((array) $seoSettingsField->sitemapEnabledFields) |
|
450 | 450 | ); |
451 | 451 | $attributes = array_filter( |
452 | 452 | $attributes, |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | */ |
479 | 479 | protected static function assetSitemapItem(Asset $asset, MetaBundle $metaBundle, array &$lines) |
480 | 480 | { |
481 | - if ((bool)$asset->enabledForSite && $asset->getUrl() !== null) { |
|
481 | + if ((bool) $asset->enabledForSite && $asset->getUrl() !== null) { |
|
482 | 482 | switch ($asset->kind) { |
483 | 483 | case 'image': |
484 | 484 | $lines[] = '<image:image>'; |
@@ -490,9 +490,9 @@ discard block |
||
490 | 490 | $fieldName = $row['field'] ?? ''; |
491 | 491 | $propName = $row['property'] ?? ''; |
492 | 492 | if (!empty($asset[$fieldName]) && !empty($propName)) { |
493 | - $lines[] = '<image:' . $propName . '>'; |
|
493 | + $lines[] = '<image:'.$propName.'>'; |
|
494 | 494 | $lines[] = Html::encode($asset[$fieldName]); |
495 | - $lines[] = '</image:' . $propName . '>'; |
|
495 | + $lines[] = '</image:'.$propName.'>'; |
|
496 | 496 | } |
497 | 497 | } |
498 | 498 | $lines[] = '</image:image>'; |
@@ -508,9 +508,9 @@ discard block |
||
508 | 508 | $fieldName = $row['field'] ?? ''; |
509 | 509 | $propName = $row['property'] ?? ''; |
510 | 510 | if (!empty($asset[$fieldName]) && !empty($propName)) { |
511 | - $lines[] = '<video:' . $propName . '>'; |
|
511 | + $lines[] = '<video:'.$propName.'>'; |
|
512 | 512 | $lines[] = Html::encode($asset[$fieldName]); |
513 | - $lines[] = '</video:' . $propName . '>'; |
|
513 | + $lines[] = '</video:'.$propName.'>'; |
|
514 | 514 | } |
515 | 515 | } |
516 | 516 | $lines[] = '</video:video>'; |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | */ |
527 | 527 | protected static function assetFilesSitemapLink(Asset $asset, MetaBundle $metaBundle, array &$lines) |
528 | 528 | { |
529 | - if ((bool)$asset->enabledForSite && $asset->getUrl() !== null) { |
|
529 | + if ((bool) $asset->enabledForSite && $asset->getUrl() !== null) { |
|
530 | 530 | if (\in_array($asset->kind, SitemapTemplate::FILE_TYPES, false)) { |
531 | 531 | $dateUpdated = $asset->dateUpdated ?? $asset->dateCreated ?? new \DateTime; |
532 | 532 | $lines[] = '<url>'; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | Event::on( |
109 | 109 | Sections::class, |
110 | 110 | Sections::EVENT_AFTER_SAVE_SECTION, |
111 | - function (SectionEvent $event) { |
|
111 | + function(SectionEvent $event) { |
|
112 | 112 | Craft::debug( |
113 | 113 | 'Sections::EVENT_AFTER_SAVE_SECTION', |
114 | 114 | __METHOD__ |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | Event::on( |
120 | 120 | Sections::class, |
121 | 121 | Sections::EVENT_AFTER_DELETE_SECTION, |
122 | - function (SectionEvent $event) { |
|
122 | + function(SectionEvent $event) { |
|
123 | 123 | Craft::debug( |
124 | 124 | 'Sections::EVENT_AFTER_DELETE_SECTION', |
125 | 125 | __METHOD__ |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | Event::on( |
135 | 135 | Sections::class, |
136 | 136 | Sections::EVENT_AFTER_SAVE_SECTION, |
137 | - function (SectionEvent $event) { |
|
137 | + function(SectionEvent $event) { |
|
138 | 138 | Craft::debug( |
139 | 139 | 'Sections::EVENT_AFTER_SAVE_SECTION', |
140 | 140 | __METHOD__ |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | Event::on( |
158 | 158 | Sections::class, |
159 | 159 | Sections::EVENT_AFTER_DELETE_SECTION, |
160 | - function (SectionEvent $event) { |
|
160 | + function(SectionEvent $event) { |
|
161 | 161 | Craft::debug( |
162 | 162 | 'Sections::EVENT_AFTER_DELETE_SECTION', |
163 | 163 | __METHOD__ |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | Event::on( |
187 | 187 | Entry::class, |
188 | 188 | Entry::EVENT_DEFINE_SIDEBAR_HTML, |
189 | - static function (DefineHtmlEvent $event) { |
|
189 | + static function(DefineHtmlEvent $event) { |
|
190 | 190 | Craft::debug( |
191 | 191 | 'Entry::EVENT_DEFINE_SIDEBAR_HTML', |
192 | 192 | __METHOD__ |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | ->limit($metaBundle->metaSitemapVars->sitemapLimit); |
228 | 228 | if ($metaBundle->sourceType === 'structure' |
229 | 229 | && !empty($metaBundle->metaSitemapVars->structureDepth)) { |
230 | - $query->level('<=' . $metaBundle->metaSitemapVars->structureDepth); |
|
230 | + $query->level('<='.$metaBundle->metaSitemapVars->structureDepth); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | return $query; |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
396 | 396 | [ |
397 | 397 | 'sourceId' => $sourceModel->id, |
398 | - 'sourceName' => (string)$sourceModel->name, |
|
398 | + 'sourceName' => (string) $sourceModel->name, |
|
399 | 399 | 'sourceHandle' => $sourceModel->handle, |
400 | 400 | 'sourceType' => $sourceModel->type, |
401 | 401 | ] |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | Event::on( |
107 | 107 | Categories::class, |
108 | 108 | Categories::EVENT_AFTER_SAVE_GROUP, |
109 | - function (CategoryGroupEvent $event) { |
|
109 | + function(CategoryGroupEvent $event) { |
|
110 | 110 | Craft::debug( |
111 | 111 | 'Categories::EVENT_AFTER_SAVE_GROUP', |
112 | 112 | __METHOD__ |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | Event::on( |
118 | 118 | Categories::class, |
119 | 119 | Categories::EVENT_AFTER_DELETE_GROUP, |
120 | - function (CategoryGroupEvent $event) { |
|
120 | + function(CategoryGroupEvent $event) { |
|
121 | 121 | Craft::debug( |
122 | 122 | 'Categories::EVENT_AFTER_DELETE_GROUP', |
123 | 123 | __METHOD__ |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | Event::on( |
133 | 133 | Categories::class, |
134 | 134 | Categories::EVENT_AFTER_SAVE_GROUP, |
135 | - function (CategoryGroupEvent $event) { |
|
135 | + function(CategoryGroupEvent $event) { |
|
136 | 136 | Craft::debug( |
137 | 137 | 'Categories::EVENT_AFTER_SAVE_GROUP', |
138 | 138 | __METHOD__ |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | Event::on( |
156 | 156 | Categories::class, |
157 | 157 | Categories::EVENT_AFTER_DELETE_GROUP, |
158 | - function (CategoryGroupEvent $event) { |
|
158 | + function(CategoryGroupEvent $event) { |
|
159 | 159 | Craft::debug( |
160 | 160 | 'Categories::EVENT_AFTER_DELETE_GROUP', |
161 | 161 | __METHOD__ |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | Event::on( |
185 | 185 | Category::class, |
186 | 186 | Category::EVENT_DEFINE_SIDEBAR_HTML, |
187 | - static function (DefineHtmlEvent $event) { |
|
187 | + static function(DefineHtmlEvent $event) { |
|
188 | 188 | Craft::debug( |
189 | 189 | 'Category::EVENT_DEFINE_SIDEBAR_HTML', |
190 | 190 | __METHOD__ |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | ->siteId($metaBundle->sourceSiteId) |
225 | 225 | ->limit($metaBundle->metaSitemapVars->sitemapLimit); |
226 | 226 | if (!empty($metaBundle->metaSitemapVars->structureDepth)) { |
227 | - $query->level('<=' . $metaBundle->metaSitemapVars->structureDepth); |
|
227 | + $query->level('<='.$metaBundle->metaSitemapVars->structureDepth); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | return $query; |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
382 | 382 | [ |
383 | 383 | 'sourceId' => $sourceModel->id, |
384 | - 'sourceName' => (string)$sourceModel->name, |
|
384 | + 'sourceName' => (string) $sourceModel->name, |
|
385 | 385 | 'sourceHandle' => $sourceModel->handle, |
386 | 386 | ] |
387 | 387 | ); |
@@ -54,7 +54,7 @@ |
||
54 | 54 | $result = MetaValueHelper::parseString($this->$property); |
55 | 55 | } |
56 | 56 | |
57 | - return (string)$result; |
|
57 | + return (string) $result; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | // Constants |
43 | 43 | // ========================================================================= |
44 | 44 | |
45 | - const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapIndexTemplate::TEMPLATE_TYPE; |
|
45 | + const SEOMATIC_SITEMAPINDEX_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapIndexTemplate::TEMPLATE_TYPE; |
|
46 | 46 | |
47 | - const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapTemplate::TEMPLATE_TYPE; |
|
47 | + const SEOMATIC_SITEMAP_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapTemplate::TEMPLATE_TYPE; |
|
48 | 48 | |
49 | - const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE . SitemapCustomTemplate::TEMPLATE_TYPE; |
|
49 | + const SEOMATIC_SITEMAPCUSTOM_CONTAINER = Seomatic::SEOMATIC_HANDLE.SitemapCustomTemplate::TEMPLATE_TYPE; |
|
50 | 50 | |
51 | 51 | const SEARCH_ENGINE_SUBMISSION_URLS = [ |
52 | 52 | 'google' => 'https://www.google.com/ping?sitemap=', |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | Event::on( |
92 | 92 | UrlManager::class, |
93 | 93 | UrlManager::EVENT_REGISTER_SITE_URL_RULES, |
94 | - function (RegisterUrlRulesEvent $event) { |
|
94 | + function(RegisterUrlRulesEvent $event) { |
|
95 | 95 | Craft::debug( |
96 | 96 | 'UrlManager::EVENT_REGISTER_SITE_URL_RULES', |
97 | 97 | __METHOD__ |
@@ -244,19 +244,19 @@ discard block |
||
244 | 244 | $siteId = $groupSiteIds[0]; |
245 | 245 | $sitemapIndexUrl = $this->sitemapIndexUrlForSiteId($siteId); |
246 | 246 | if (!empty($sitemapIndexUrl)) { |
247 | - $submissionUrl = $url . urlencode($sitemapIndexUrl); |
|
247 | + $submissionUrl = $url.urlencode($sitemapIndexUrl); |
|
248 | 248 | // create new guzzle client |
249 | 249 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
250 | 250 | // Submit the sitemap index to each search engine |
251 | 251 | try { |
252 | 252 | $guzzleClient->post($submissionUrl); |
253 | 253 | Craft::info( |
254 | - 'Sitemap index submitted to: ' . $submissionUrl, |
|
254 | + 'Sitemap index submitted to: '.$submissionUrl, |
|
255 | 255 | __METHOD__ |
256 | 256 | ); |
257 | 257 | } catch (\Exception $e) { |
258 | 258 | Craft::error( |
259 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
259 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
260 | 260 | __METHOD__ |
261 | 261 | ); |
262 | 262 | } |
@@ -316,19 +316,19 @@ discard block |
||
316 | 316 | foreach ($searchEngineUrls as &$url) { |
317 | 317 | $sitemapUrl = $this->sitemapUrlForBundle($sourceBundleType, $sourceHandle, $sourceSiteId); |
318 | 318 | if (!empty($sitemapUrl)) { |
319 | - $submissionUrl = $url . urlencode($sitemapUrl); |
|
319 | + $submissionUrl = $url.urlencode($sitemapUrl); |
|
320 | 320 | // create new guzzle client |
321 | 321 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
322 | 322 | // Submit the sitemap index to each search engine |
323 | 323 | try { |
324 | 324 | $guzzleClient->post($submissionUrl); |
325 | 325 | Craft::info( |
326 | - 'Sitemap index submitted to: ' . $submissionUrl, |
|
326 | + 'Sitemap index submitted to: '.$submissionUrl, |
|
327 | 327 | __METHOD__ |
328 | 328 | ); |
329 | 329 | } catch (\Exception $e) { |
330 | 330 | Craft::error( |
331 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
331 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
332 | 332 | __METHOD__ |
333 | 333 | ); |
334 | 334 | } |
@@ -394,19 +394,19 @@ discard block |
||
394 | 394 | foreach ($searchEngineUrls as &$url) { |
395 | 395 | $sitemapUrl = $this->sitemapCustomUrlForSiteId($siteId); |
396 | 396 | if (!empty($sitemapUrl)) { |
397 | - $submissionUrl = $url . urlencode($sitemapUrl); |
|
397 | + $submissionUrl = $url.urlencode($sitemapUrl); |
|
398 | 398 | // create new guzzle client |
399 | 399 | $guzzleClient = Craft::createGuzzleClient(['timeout' => 5, 'connect_timeout' => 5]); |
400 | 400 | // Submit the sitemap index to each search engine |
401 | 401 | try { |
402 | 402 | $guzzleClient->post($submissionUrl); |
403 | 403 | Craft::info( |
404 | - 'Sitemap Custom submitted to: ' . $submissionUrl, |
|
404 | + 'Sitemap Custom submitted to: '.$submissionUrl, |
|
405 | 405 | __METHOD__ |
406 | 406 | ); |
407 | 407 | } catch (\Exception $e) { |
408 | 408 | Craft::error( |
409 | - 'Error submitting sitemap index to: ' . $submissionUrl . ' - ' . $e->getMessage(), |
|
409 | + 'Error submitting sitemap index to: '.$submissionUrl.' - '.$e->getMessage(), |
|
410 | 410 | __METHOD__ |
411 | 411 | ); |
412 | 412 | } |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | } |
485 | 485 | |
486 | 486 | foreach ($sites as $site) { |
487 | - $result .= 'sitemap: ' . $this->sitemapIndexUrlForSiteId($site->id) . PHP_EOL; |
|
487 | + $result .= 'sitemap: '.$this->sitemapIndexUrlForSiteId($site->id).PHP_EOL; |
|
488 | 488 | } |
489 | 489 | |
490 | 490 | return rtrim($result, PHP_EOL); |
@@ -516,9 +516,9 @@ discard block |
||
516 | 516 | // Since we want a stale-while-revalidate pattern, only invalidate the cache if we're asked to |
517 | 517 | if ($invalidateCache) { |
518 | 518 | $cache = Craft::$app->getCache(); |
519 | - TagDependency::invalidate($cache, SitemapTemplate::SITEMAP_CACHE_TAG . $handle . $siteId); |
|
519 | + TagDependency::invalidate($cache, SitemapTemplate::SITEMAP_CACHE_TAG.$handle.$siteId); |
|
520 | 520 | Craft::info( |
521 | - 'Sitemap cache cleared: ' . $handle, |
|
521 | + 'Sitemap cache cleared: '.$handle, |
|
522 | 522 | __METHOD__ |
523 | 523 | ); |
524 | 524 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | BaseEvent::on( |
87 | 87 | CalendarsService::class, |
88 | 88 | CalendarsService::EVENT_AFTER_SAVE, |
89 | - function (SaveModelEvent $event) { |
|
89 | + function(SaveModelEvent $event) { |
|
90 | 90 | Craft::debug( |
91 | 91 | 'CalendarsService::EVENT_AFTER_DELETE', |
92 | 92 | __METHOD__ |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | BaseEvent::on( |
98 | 98 | CalendarsService::class, |
99 | 99 | CalendarsService::EVENT_AFTER_DELETE, |
100 | - function (DeleteModelEvent $event) { |
|
100 | + function(DeleteModelEvent $event) { |
|
101 | 101 | Craft::debug( |
102 | 102 | 'CalendarsService::EVENT_AFTER_DELETE', |
103 | 103 | __METHOD__ |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | BaseEvent::on( |
113 | 113 | CalendarsService::class, |
114 | 114 | CalendarsService::EVENT_AFTER_SAVE, |
115 | - function (SaveModelEvent $event) { |
|
115 | + function(SaveModelEvent $event) { |
|
116 | 116 | Craft::debug( |
117 | 117 | 'CalendarsService::EVENT_AFTER_SAVE', |
118 | 118 | __METHOD__ |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | BaseEvent::on( |
138 | 138 | CalendarsService::class, |
139 | 139 | CalendarsService::EVENT_AFTER_DELETE, |
140 | - function (DeleteModelEvent $event) { |
|
140 | + function(DeleteModelEvent $event) { |
|
141 | 141 | Craft::debug( |
142 | 142 | 'CalendarsService::EVENT_AFTER_DELETE', |
143 | 143 | __METHOD__ |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | BaseEvent::on( |
169 | 169 | Event::class, |
170 | 170 | Event::EVENT_DEFINE_SIDEBAR_HTML, |
171 | - static function (DefineHtmlEvent $event) { |
|
171 | + static function(DefineHtmlEvent $event) { |
|
172 | 172 | Craft::debug( |
173 | 173 | 'Entry::EVENT_DEFINE_SIDEBAR_HTML', |
174 | 174 | __METHOD__ |
@@ -243,8 +243,8 @@ discard block |
||
243 | 243 | $query = Event::find() |
244 | 244 | ->setCalendar($metaBundle->sourceHandle) |
245 | 245 | ->setLoadOccurrences(false) |
246 | - ->siteId((int)$metaBundle->sourceSiteId) |
|
247 | - ->limit((int)$metaBundle->metaSitemapVars->sitemapLimit); |
|
246 | + ->siteId((int) $metaBundle->sourceSiteId) |
|
247 | + ->limit((int) $metaBundle->metaSitemapVars->sitemapLimit); |
|
248 | 248 | |
249 | 249 | return $query; |
250 | 250 | } |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
406 | 406 | [ |
407 | 407 | 'sourceId' => $sourceModel->id, |
408 | - 'sourceName' => (string)$sourceModel->name, |
|
408 | + 'sourceName' => (string) $sourceModel->name, |
|
409 | 409 | 'sourceHandle' => $sourceModel->handle, |
410 | 410 | ] |
411 | 411 | ); |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | // so we can't extract it from the passed in $config |
64 | 64 | $majorVersion = '4'; |
65 | 65 | // Dev server container name & port are based on the major version of this plugin |
66 | - $devPort = 3000 + (int)$majorVersion; |
|
67 | - $versionName = 'v' . $majorVersion; |
|
66 | + $devPort = 3000 + (int) $majorVersion; |
|
67 | + $versionName = 'v'.$majorVersion; |
|
68 | 68 | return [ |
69 | 69 | 'components' => [ |
70 | 70 | 'frontendTemplates' => FrontendTemplatesService::class, |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | 'assetClass' => SeomaticAsset::class, |
84 | 84 | 'checkDevServer' => true, |
85 | 85 | 'class' => VitePluginService::class, |
86 | - 'devServerInternal' => 'http://craft-seomatic-' . $versionName . '-buildchain-dev:' . $devPort, |
|
87 | - 'devServerPublic' => 'http://localhost:' . $devPort, |
|
86 | + 'devServerInternal' => 'http://craft-seomatic-'.$versionName.'-buildchain-dev:'.$devPort, |
|
87 | + 'devServerPublic' => 'http://localhost:'.$devPort, |
|
88 | 88 | 'errorEntry' => 'src/js/seomatic.js', |
89 | 89 | 'useDevServer' => true, |
90 | 90 | ], |
@@ -23,130 +23,130 @@ |
||
23 | 23 | */ |
24 | 24 | class MenuItem extends MetaJsonLd implements MenuItemInterface, IntangibleInterface, ThingInterface |
25 | 25 | { |
26 | - use MenuItemTrait; |
|
27 | - use IntangibleTrait; |
|
28 | - use ThingTrait; |
|
29 | - |
|
30 | - /** |
|
31 | - * The Schema.org Type Name |
|
32 | - * |
|
33 | - * @var string |
|
34 | - */ |
|
35 | - public static string $schemaTypeName = 'MenuItem'; |
|
36 | - |
|
37 | - /** |
|
38 | - * The Schema.org Type Scope |
|
39 | - * |
|
40 | - * @var string |
|
41 | - */ |
|
42 | - public static string $schemaTypeScope = 'https://schema.org/MenuItem'; |
|
43 | - |
|
44 | - /** |
|
45 | - * The Schema.org Type Extends |
|
46 | - * |
|
47 | - * @var string |
|
48 | - */ |
|
49 | - public static string $schemaTypeExtends = 'Intangible'; |
|
50 | - |
|
51 | - /** |
|
52 | - * The Schema.org Type Description |
|
53 | - * |
|
54 | - * @var string |
|
55 | - */ |
|
56 | - public static string $schemaTypeDescription = 'A food or drink item listed in a menu or menu section.'; |
|
57 | - |
|
58 | - |
|
59 | - /** |
|
60 | - * @inheritdoc |
|
61 | - */ |
|
62 | - public function getSchemaPropertyNames(): array |
|
63 | - { |
|
64 | - return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
65 | - } |
|
66 | - |
|
67 | - |
|
68 | - /** |
|
69 | - * @inheritdoc |
|
70 | - */ |
|
71 | - public function getSchemaPropertyExpectedTypes(): array |
|
72 | - { |
|
73 | - return [ |
|
74 | - 'additionalType' => ['URL'], |
|
75 | - 'alternateName' => ['Text'], |
|
76 | - 'description' => ['Text'], |
|
77 | - 'disambiguatingDescription' => ['Text'], |
|
78 | - 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
79 | - 'image' => ['URL', 'ImageObject'], |
|
80 | - 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
81 | - 'menuAddOn' => ['MenuItem', 'MenuSection'], |
|
82 | - 'name' => ['Text'], |
|
83 | - 'nutrition' => ['NutritionInformation'], |
|
84 | - 'offers' => ['Demand', 'Offer'], |
|
85 | - 'potentialAction' => ['Action'], |
|
86 | - 'sameAs' => ['URL'], |
|
87 | - 'subjectOf' => ['Event', 'CreativeWork'], |
|
88 | - 'suitableForDiet' => ['RestrictedDiet'], |
|
89 | - 'url' => ['URL'] |
|
90 | - ]; |
|
91 | - } |
|
92 | - |
|
93 | - |
|
94 | - /** |
|
95 | - * @inheritdoc |
|
96 | - */ |
|
97 | - public function getSchemaPropertyDescriptions(): array |
|
98 | - { |
|
99 | - return [ |
|
100 | - 'additionalType' => 'An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the \'typeof\' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.', |
|
101 | - 'alternateName' => 'An alias for the item.', |
|
102 | - 'description' => 'A description of the item.', |
|
103 | - 'disambiguatingDescription' => 'A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.', |
|
104 | - 'identifier' => 'The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details. ', |
|
105 | - 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
106 | - 'mainEntityOfPage' => 'Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.', |
|
107 | - 'menuAddOn' => 'Additional menu item(s) such as a side dish of salad or side order of fries that can be added to this menu item. Additionally it can be a menu section containing allowed add-on menu items for this menu item.', |
|
108 | - 'name' => 'The name of the item.', |
|
109 | - 'nutrition' => 'Nutrition information about the recipe or menu item.', |
|
110 | - 'offers' => 'An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]] to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can also be used to describe a [[Demand]]. While this property is listed as expected on a number of common types, it can be used in others. In that case, using a second type, such as Product or a subtype of Product, can clarify the nature of the offer. ', |
|
111 | - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
112 | - 'sameAs' => 'URL of a reference Web page that unambiguously indicates the item\'s identity. E.g. the URL of the item\'s Wikipedia page, Wikidata entry, or official website.', |
|
113 | - 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
114 | - 'suitableForDiet' => 'Indicates a dietary restriction or guideline for which this recipe or menu item is suitable, e.g. diabetic, halal etc.', |
|
115 | - 'url' => 'URL of the item.' |
|
116 | - ]; |
|
117 | - } |
|
118 | - |
|
119 | - |
|
120 | - /** |
|
121 | - * @inheritdoc |
|
122 | - */ |
|
123 | - public function getGoogleRequiredSchema(): array |
|
124 | - { |
|
125 | - return ['description', 'name']; |
|
126 | - } |
|
127 | - |
|
128 | - |
|
129 | - /** |
|
130 | - * @inheritdoc |
|
131 | - */ |
|
132 | - public function getGoogleRecommendedSchema(): array |
|
133 | - { |
|
134 | - return ['image', 'url']; |
|
135 | - } |
|
136 | - |
|
137 | - |
|
138 | - /** |
|
139 | - * @inheritdoc |
|
140 | - */ |
|
141 | - public function defineRules(): array |
|
142 | - { |
|
143 | - $rules = parent::defineRules(); |
|
144 | - $rules = array_merge($rules, [ |
|
145 | - [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
146 | - [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
147 | - [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
148 | - ]); |
|
149 | - |
|
150 | - return $rules; |
|
151 | - } |
|
26 | + use MenuItemTrait; |
|
27 | + use IntangibleTrait; |
|
28 | + use ThingTrait; |
|
29 | + |
|
30 | + /** |
|
31 | + * The Schema.org Type Name |
|
32 | + * |
|
33 | + * @var string |
|
34 | + */ |
|
35 | + public static string $schemaTypeName = 'MenuItem'; |
|
36 | + |
|
37 | + /** |
|
38 | + * The Schema.org Type Scope |
|
39 | + * |
|
40 | + * @var string |
|
41 | + */ |
|
42 | + public static string $schemaTypeScope = 'https://schema.org/MenuItem'; |
|
43 | + |
|
44 | + /** |
|
45 | + * The Schema.org Type Extends |
|
46 | + * |
|
47 | + * @var string |
|
48 | + */ |
|
49 | + public static string $schemaTypeExtends = 'Intangible'; |
|
50 | + |
|
51 | + /** |
|
52 | + * The Schema.org Type Description |
|
53 | + * |
|
54 | + * @var string |
|
55 | + */ |
|
56 | + public static string $schemaTypeDescription = 'A food or drink item listed in a menu or menu section.'; |
|
57 | + |
|
58 | + |
|
59 | + /** |
|
60 | + * @inheritdoc |
|
61 | + */ |
|
62 | + public function getSchemaPropertyNames(): array |
|
63 | + { |
|
64 | + return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
65 | + } |
|
66 | + |
|
67 | + |
|
68 | + /** |
|
69 | + * @inheritdoc |
|
70 | + */ |
|
71 | + public function getSchemaPropertyExpectedTypes(): array |
|
72 | + { |
|
73 | + return [ |
|
74 | + 'additionalType' => ['URL'], |
|
75 | + 'alternateName' => ['Text'], |
|
76 | + 'description' => ['Text'], |
|
77 | + 'disambiguatingDescription' => ['Text'], |
|
78 | + 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
79 | + 'image' => ['URL', 'ImageObject'], |
|
80 | + 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
81 | + 'menuAddOn' => ['MenuItem', 'MenuSection'], |
|
82 | + 'name' => ['Text'], |
|
83 | + 'nutrition' => ['NutritionInformation'], |
|
84 | + 'offers' => ['Demand', 'Offer'], |
|
85 | + 'potentialAction' => ['Action'], |
|
86 | + 'sameAs' => ['URL'], |
|
87 | + 'subjectOf' => ['Event', 'CreativeWork'], |
|
88 | + 'suitableForDiet' => ['RestrictedDiet'], |
|
89 | + 'url' => ['URL'] |
|
90 | + ]; |
|
91 | + } |
|
92 | + |
|
93 | + |
|
94 | + /** |
|
95 | + * @inheritdoc |
|
96 | + */ |
|
97 | + public function getSchemaPropertyDescriptions(): array |
|
98 | + { |
|
99 | + return [ |
|
100 | + 'additionalType' => 'An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the \'typeof\' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.', |
|
101 | + 'alternateName' => 'An alias for the item.', |
|
102 | + 'description' => 'A description of the item.', |
|
103 | + 'disambiguatingDescription' => 'A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.', |
|
104 | + 'identifier' => 'The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details. ', |
|
105 | + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
106 | + 'mainEntityOfPage' => 'Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.', |
|
107 | + 'menuAddOn' => 'Additional menu item(s) such as a side dish of salad or side order of fries that can be added to this menu item. Additionally it can be a menu section containing allowed add-on menu items for this menu item.', |
|
108 | + 'name' => 'The name of the item.', |
|
109 | + 'nutrition' => 'Nutrition information about the recipe or menu item.', |
|
110 | + 'offers' => 'An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]] to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can also be used to describe a [[Demand]]. While this property is listed as expected on a number of common types, it can be used in others. In that case, using a second type, such as Product or a subtype of Product, can clarify the nature of the offer. ', |
|
111 | + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
112 | + 'sameAs' => 'URL of a reference Web page that unambiguously indicates the item\'s identity. E.g. the URL of the item\'s Wikipedia page, Wikidata entry, or official website.', |
|
113 | + 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
114 | + 'suitableForDiet' => 'Indicates a dietary restriction or guideline for which this recipe or menu item is suitable, e.g. diabetic, halal etc.', |
|
115 | + 'url' => 'URL of the item.' |
|
116 | + ]; |
|
117 | + } |
|
118 | + |
|
119 | + |
|
120 | + /** |
|
121 | + * @inheritdoc |
|
122 | + */ |
|
123 | + public function getGoogleRequiredSchema(): array |
|
124 | + { |
|
125 | + return ['description', 'name']; |
|
126 | + } |
|
127 | + |
|
128 | + |
|
129 | + /** |
|
130 | + * @inheritdoc |
|
131 | + */ |
|
132 | + public function getGoogleRecommendedSchema(): array |
|
133 | + { |
|
134 | + return ['image', 'url']; |
|
135 | + } |
|
136 | + |
|
137 | + |
|
138 | + /** |
|
139 | + * @inheritdoc |
|
140 | + */ |
|
141 | + public function defineRules(): array |
|
142 | + { |
|
143 | + $rules = parent::defineRules(); |
|
144 | + $rules = array_merge($rules, [ |
|
145 | + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
146 | + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
147 | + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
148 | + ]); |
|
149 | + |
|
150 | + return $rules; |
|
151 | + } |
|
152 | 152 | } |