@@ -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 | } |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | $siteUrl = MetaValue::parseString($siteUrl); |
41 | 41 | // Extract out just the path part |
42 | 42 | $parts = self::decomposeUrl($path); |
43 | - $path = $parts['path'] . $parts['suffix']; |
|
44 | - $url = rtrim($siteUrl, '/') . '/' . ltrim($path, '/'); |
|
43 | + $path = $parts['path'].$parts['suffix']; |
|
44 | + $url = rtrim($siteUrl, '/').'/'.ltrim($path, '/'); |
|
45 | 45 | // Handle trailing slashes properly for generated URLs |
46 | 46 | $generalConfig = Craft::$app->getConfig()->getGeneral(); |
47 | 47 | if ($generalConfig->addTrailingSlashesToUrls && !preg_match('/\.[^\/]+$/', $url)) { |
48 | - $url = rtrim($url, '/') . '/'; |
|
48 | + $url = rtrim($url, '/').'/'; |
|
49 | 49 | } |
50 | 50 | if (!$generalConfig->addTrailingSlashesToUrls) { |
51 | 51 | $url = rtrim($url, '/'); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | // Handle trailing slashes properly for generated URLs |
123 | 123 | $generalConfig = Craft::$app->getConfig()->getGeneral(); |
124 | 124 | if ($generalConfig->addTrailingSlashesToUrls && !preg_match('/\.[^\/]+$/', $url)) { |
125 | - $url = rtrim($url, '/') . '/'; |
|
125 | + $url = rtrim($url, '/').'/'; |
|
126 | 126 | } |
127 | 127 | if (!$generalConfig->addTrailingSlashesToUrls) { |
128 | 128 | $url = rtrim($url, '/'); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $urlParts = parse_url($url); |
143 | 143 | $encodedUrl = ""; |
144 | 144 | if (isset($urlParts['scheme'])) { |
145 | - $encodedUrl .= $urlParts['scheme'] . '://'; |
|
145 | + $encodedUrl .= $urlParts['scheme'].'://'; |
|
146 | 146 | } |
147 | 147 | if (isset($urlParts['host'])) { |
148 | 148 | $encodedUrl .= $urlParts['host']; |
@@ -155,15 +155,15 @@ discard block |
||
155 | 155 | foreach ($query as $j => $value) { |
156 | 156 | $value = explode('=', $value, 2); |
157 | 157 | if (count($value) === 2) { |
158 | - $query[$j] = urlencode($value[0]) . '=' . urlencode($value[1]); |
|
158 | + $query[$j] = urlencode($value[0]).'='.urlencode($value[1]); |
|
159 | 159 | } else { |
160 | 160 | $query[$j] = urlencode($value[0]); |
161 | 161 | } |
162 | 162 | } |
163 | - $encodedUrl .= '?' . implode('&', $query); |
|
163 | + $encodedUrl .= '?'.implode('&', $query); |
|
164 | 164 | } |
165 | 165 | if (isset($urlParts['fragment'])) { |
166 | - $encodedUrl .= '#' . $urlParts['fragment']; |
|
166 | + $encodedUrl .= '#'.$urlParts['fragment']; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | return $encodedUrl; |
@@ -196,11 +196,11 @@ discard block |
||
196 | 196 | |
197 | 197 | if (filter_var($pathOrUrl, FILTER_VALIDATE_URL)) { |
198 | 198 | $url_parts = parse_url($pathOrUrl); |
199 | - $result['prefix'] = $url_parts['scheme'] . '://' . $url_parts['host']; |
|
199 | + $result['prefix'] = $url_parts['scheme'].'://'.$url_parts['host']; |
|
200 | 200 | $result['path'] = $url_parts['path'] ?? ''; |
201 | 201 | $result['suffix'] = ''; |
202 | - $result['suffix'] .= empty($url_parts['query']) ? '' : '?' . $url_parts['query']; |
|
203 | - $result['suffix'] .= empty($url_parts['fragment']) ? '' : '#' . $url_parts['fragment']; |
|
202 | + $result['suffix'] .= empty($url_parts['query']) ? '' : '?'.$url_parts['query']; |
|
203 | + $result['suffix'] .= empty($url_parts['fragment']) ? '' : '#'.$url_parts['fragment']; |
|
204 | 204 | } else { |
205 | 205 | $result['prefix'] = ''; |
206 | 206 | $result['path'] = $pathOrUrl; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | // Go from most specific type to least specific type |
81 | 81 | foreach (self::SCHEMA_TYPES as $schemaType) { |
82 | 82 | if (!empty($settings[$schemaType]) && ($settings[$schemaType] !== 'none')) { |
83 | - $result = $settings[$schemaType] . self::SCHEMA_PATH_DELIMITER . $result; |
|
83 | + $result = $settings[$schemaType].self::SCHEMA_PATH_DELIMITER.$result; |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | { |
127 | 127 | $result = []; |
128 | 128 | while ($schemaType) { |
129 | - $className = 'nystudio107\\seomatic\\models\\jsonld\\' . $schemaType; |
|
129 | + $className = 'nystudio107\\seomatic\\models\\jsonld\\'.$schemaType; |
|
130 | 130 | if (class_exists($className)) { |
131 | 131 | try { |
132 | 132 | $classRef = new \ReflectionClass($className); |
@@ -289,11 +289,11 @@ discard block |
||
289 | 289 | foreach ($typesArray as $key => $value) { |
290 | 290 | $indent = html_entity_decode(str_repeat(' ', $indentLevel)); |
291 | 291 | if (\is_array($value)) { |
292 | - $result[$key] = $indent . $key; |
|
292 | + $result[$key] = $indent.$key; |
|
293 | 293 | $value = self::flattenSchemaArray($value, $indentLevel + self::MENU_INDENT_STEP); |
294 | 294 | $result = array_merge($result, $value); |
295 | 295 | } else { |
296 | - $result[$key] = $indent . $value; |
|
296 | + $result[$key] = $indent.$value; |
|
297 | 297 | } |
298 | 298 | } |
299 | 299 | |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | $children = []; |
392 | 392 | $name = $typesArray['name']; |
393 | 393 | // Construct a path-based $id, excluding the top-level `Thing` schema |
394 | - $id = $name === 'Thing' ? '' : $path . self::SCHEMA_PATH_DELIMITER . $name; |
|
394 | + $id = $name === 'Thing' ? '' : $path.self::SCHEMA_PATH_DELIMITER.$name; |
|
395 | 395 | $id = ltrim($id, self::SCHEMA_PATH_DELIMITER); |
396 | 396 | // Make sure we have at most 3 specifiers in the schema path |
397 | 397 | $parts = explode(self::SCHEMA_PATH_DELIMITER, $id); |
@@ -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 | ); |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $lastSegment = end($segments); |
342 | 342 | $site = Craft::$app->getSites()->getSiteByHandle($lastSegment); |
343 | 343 | if ($site !== null) { |
344 | - $siteSuffix = '/' . $lastSegment; |
|
344 | + $siteSuffix = '/'.$lastSegment; |
|
345 | 345 | } |
346 | 346 | } |
347 | 347 | $currentUser = Craft::$app->getUser()->getIdentity(); |
@@ -349,31 +349,31 @@ discard block |
||
349 | 349 | if ($currentUser->can('seomatic:dashboard')) { |
350 | 350 | $subNavs['dashboard'] = [ |
351 | 351 | 'label' => Craft::t('seomatic', 'Dashboard'), |
352 | - 'url' => 'seomatic/dashboard' . $siteSuffix, |
|
352 | + 'url' => 'seomatic/dashboard'.$siteSuffix, |
|
353 | 353 | ]; |
354 | 354 | } |
355 | 355 | if ($currentUser->can('seomatic:global-meta')) { |
356 | 356 | $subNavs['global'] = [ |
357 | 357 | 'label' => Craft::t('seomatic', 'Global SEO'), |
358 | - 'url' => 'seomatic/global/general' . $siteSuffix, |
|
358 | + 'url' => 'seomatic/global/general'.$siteSuffix, |
|
359 | 359 | ]; |
360 | 360 | } |
361 | 361 | if ($currentUser->can('seomatic:content-meta')) { |
362 | 362 | $subNavs['content'] = [ |
363 | 363 | 'label' => Craft::t('seomatic', 'Content SEO'), |
364 | - 'url' => 'seomatic/content' . $siteSuffix, |
|
364 | + 'url' => 'seomatic/content'.$siteSuffix, |
|
365 | 365 | ]; |
366 | 366 | } |
367 | 367 | if ($currentUser->can('seomatic:site-settings')) { |
368 | 368 | $subNavs['site'] = [ |
369 | 369 | 'label' => Craft::t('seomatic', 'Site Settings'), |
370 | - 'url' => 'seomatic/site/identity' . $siteSuffix, |
|
370 | + 'url' => 'seomatic/site/identity'.$siteSuffix, |
|
371 | 371 | ]; |
372 | 372 | } |
373 | 373 | if ($currentUser->can('seomatic:tracking-scripts')) { |
374 | 374 | $subNavs['tracking'] = [ |
375 | 375 | 'label' => Craft::t('seomatic', 'Tracking Scripts'), |
376 | - 'url' => 'seomatic/tracking/gtag' . $siteSuffix, |
|
376 | + 'url' => 'seomatic/tracking/gtag'.$siteSuffix, |
|
377 | 377 | ]; |
378 | 378 | } |
379 | 379 | $editableSettings = true; |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | Event::on( |
419 | 419 | Plugins::class, |
420 | 420 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
421 | - function (PluginEvent $event) { |
|
421 | + function(PluginEvent $event) { |
|
422 | 422 | if ($event->plugin === $this) { |
423 | 423 | // Invalidate our caches after we've been installed |
424 | 424 | $this->clearAllCaches(); |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | Event::on( |
440 | 440 | ClearCaches::class, |
441 | 441 | ClearCaches::EVENT_REGISTER_CACHE_OPTIONS, |
442 | - function (RegisterCacheOptionsEvent $event) { |
|
442 | + function(RegisterCacheOptionsEvent $event) { |
|
443 | 443 | Craft::debug( |
444 | 444 | 'ClearCaches::EVENT_REGISTER_CACHE_OPTIONS', |
445 | 445 | __METHOD__ |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | Event::on( |
456 | 456 | Plugins::class, |
457 | 457 | Plugins::EVENT_BEFORE_SAVE_PLUGIN_SETTINGS, |
458 | - function (PluginEvent $event) { |
|
458 | + function(PluginEvent $event) { |
|
459 | 459 | if ($event->plugin === $this && !Craft::$app->getDb()->getSupportsMb4()) { |
460 | 460 | // For all the emojis |
461 | 461 | $settingsModel = $this->getSettings(); |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | Event::on( |
486 | 486 | Plugins::class, |
487 | 487 | Plugins::EVENT_AFTER_LOAD_PLUGINS, |
488 | - function () { |
|
488 | + function() { |
|
489 | 489 | // Delay registering SEO Elements to give other plugins a chance to load first |
490 | 490 | $this->seoElements->getAllSeoElementTypes(false); |
491 | 491 | // Delay installing GQL handlers to give other plugins a chance to register their own first |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | Event::on( |
507 | 507 | Fields::class, |
508 | 508 | Fields::EVENT_REGISTER_FIELD_TYPES, |
509 | - static function (RegisterComponentTypesEvent $event) { |
|
509 | + static function(RegisterComponentTypesEvent $event) { |
|
510 | 510 | $event->types[] = SeoSettingsField::class; |
511 | 511 | $event->types[] = Seomatic_MetaField::class; |
512 | 512 | } |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | Event::on( |
516 | 516 | Elements::class, |
517 | 517 | Elements::EVENT_AFTER_SAVE_ELEMENT, |
518 | - static function (ElementEvent $event) { |
|
518 | + static function(ElementEvent $event) { |
|
519 | 519 | Craft::debug( |
520 | 520 | 'Elements::EVENT_AFTER_SAVE_ELEMENT', |
521 | 521 | __METHOD__ |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | Event::on( |
536 | 536 | Elements::class, |
537 | 537 | Elements::EVENT_AFTER_DELETE_ELEMENT, |
538 | - static function (ElementEvent $event) { |
|
538 | + static function(ElementEvent $event) { |
|
539 | 539 | Craft::debug( |
540 | 540 | 'Elements::EVENT_AFTER_DELETE_ELEMENT', |
541 | 541 | __METHOD__ |
@@ -554,19 +554,19 @@ discard block |
||
554 | 554 | Event::on( |
555 | 555 | Entry::class, |
556 | 556 | Element::EVENT_REGISTER_PREVIEW_TARGETS, |
557 | - static function (RegisterPreviewTargetsEvent $e) { |
|
557 | + static function(RegisterPreviewTargetsEvent $e) { |
|
558 | 558 | /** @var Element $element */ |
559 | 559 | $element = $e->sender; |
560 | 560 | if ($element->uri !== null) { |
561 | 561 | $e->previewTargets[] = [ |
562 | - 'label' => ' |
@@ -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 | } |
@@ -23,162 +23,162 @@ |
||
23 | 23 | */ |
24 | 24 | class Vein extends MetaJsonLd implements VeinInterface, VesselInterface, AnatomicalStructureInterface, MedicalEntityInterface, ThingInterface |
25 | 25 | { |
26 | - use VeinTrait; |
|
27 | - use VesselTrait; |
|
28 | - use AnatomicalStructureTrait; |
|
29 | - use MedicalEntityTrait; |
|
30 | - use ThingTrait; |
|
31 | - |
|
32 | - /** |
|
33 | - * The Schema.org Type Name |
|
34 | - * |
|
35 | - * @var string |
|
36 | - */ |
|
37 | - public static string $schemaTypeName = 'Vein'; |
|
38 | - |
|
39 | - /** |
|
40 | - * The Schema.org Type Scope |
|
41 | - * |
|
42 | - * @var string |
|
43 | - */ |
|
44 | - public static string $schemaTypeScope = 'https://schema.org/Vein'; |
|
45 | - |
|
46 | - /** |
|
47 | - * The Schema.org Type Extends |
|
48 | - * |
|
49 | - * @var string |
|
50 | - */ |
|
51 | - public static string $schemaTypeExtends = 'Vessel'; |
|
52 | - |
|
53 | - /** |
|
54 | - * The Schema.org Type Description |
|
55 | - * |
|
56 | - * @var string |
|
57 | - */ |
|
58 | - public static string $schemaTypeDescription = 'A type of blood vessel that specifically carries blood to the heart.'; |
|
59 | - |
|
60 | - |
|
61 | - /** |
|
62 | - * @inheritdoc |
|
63 | - */ |
|
64 | - public function getSchemaPropertyNames(): array |
|
65 | - { |
|
66 | - return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
67 | - } |
|
68 | - |
|
69 | - |
|
70 | - /** |
|
71 | - * @inheritdoc |
|
72 | - */ |
|
73 | - public function getSchemaPropertyExpectedTypes(): array |
|
74 | - { |
|
75 | - return [ |
|
76 | - 'additionalType' => ['URL'], |
|
77 | - 'alternateName' => ['Text'], |
|
78 | - 'associatedPathophysiology' => ['Text'], |
|
79 | - 'bodyLocation' => ['Text'], |
|
80 | - 'code' => ['MedicalCode'], |
|
81 | - 'connectedTo' => ['AnatomicalStructure'], |
|
82 | - 'description' => ['Text'], |
|
83 | - 'diagram' => ['ImageObject'], |
|
84 | - 'disambiguatingDescription' => ['Text'], |
|
85 | - 'drainsTo' => ['Vessel'], |
|
86 | - 'funding' => ['Grant'], |
|
87 | - 'guideline' => ['MedicalGuideline'], |
|
88 | - 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
89 | - 'image' => ['URL', 'ImageObject'], |
|
90 | - 'legalStatus' => ['Text', 'DrugLegalStatus', 'MedicalEnumeration'], |
|
91 | - 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
92 | - 'medicineSystem' => ['MedicineSystem'], |
|
93 | - 'name' => ['Text'], |
|
94 | - 'partOfSystem' => ['AnatomicalSystem'], |
|
95 | - 'potentialAction' => ['Action'], |
|
96 | - 'recognizingAuthority' => ['Organization'], |
|
97 | - 'regionDrained' => ['AnatomicalSystem', 'AnatomicalStructure'], |
|
98 | - 'relatedCondition' => ['MedicalCondition'], |
|
99 | - 'relatedTherapy' => ['MedicalTherapy'], |
|
100 | - 'relevantSpecialty' => ['MedicalSpecialty'], |
|
101 | - 'sameAs' => ['URL'], |
|
102 | - 'study' => ['MedicalStudy'], |
|
103 | - 'subStructure' => ['AnatomicalStructure'], |
|
104 | - 'subjectOf' => ['Event', 'CreativeWork'], |
|
105 | - 'tributary' => ['AnatomicalStructure'], |
|
106 | - 'url' => ['URL'] |
|
107 | - ]; |
|
108 | - } |
|
109 | - |
|
110 | - |
|
111 | - /** |
|
112 | - * @inheritdoc |
|
113 | - */ |
|
114 | - public function getSchemaPropertyDescriptions(): array |
|
115 | - { |
|
116 | - return [ |
|
117 | - '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.', |
|
118 | - 'alternateName' => 'An alias for the item.', |
|
119 | - 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', |
|
120 | - 'bodyLocation' => 'Location in the body of the anatomical structure.', |
|
121 | - 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', |
|
122 | - 'connectedTo' => 'Other anatomical structures to which this structure is connected.', |
|
123 | - 'description' => 'A description of the item.', |
|
124 | - 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', |
|
125 | - '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.', |
|
126 | - 'drainsTo' => 'The vasculature that the vein drains into.', |
|
127 | - 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', |
|
128 | - 'guideline' => 'A medical guideline related to this entity.', |
|
129 | - '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. ', |
|
130 | - 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
131 | - 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', |
|
132 | - '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.', |
|
133 | - 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', |
|
134 | - 'name' => 'The name of the item.', |
|
135 | - 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', |
|
136 | - 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
137 | - 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', |
|
138 | - 'regionDrained' => 'The anatomical or organ system drained by this vessel; generally refers to a specific part of an organ.', |
|
139 | - 'relatedCondition' => 'A medical condition associated with this anatomy.', |
|
140 | - 'relatedTherapy' => 'A medical therapy related to this anatomy.', |
|
141 | - 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', |
|
142 | - '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.', |
|
143 | - 'study' => 'A medical study or trial related to this entity.', |
|
144 | - 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.', |
|
145 | - 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
146 | - 'tributary' => 'The anatomical or organ system that the vein flows into; a larger structure that the vein connects to.', |
|
147 | - 'url' => 'URL of the item.' |
|
148 | - ]; |
|
149 | - } |
|
150 | - |
|
151 | - |
|
152 | - /** |
|
153 | - * @inheritdoc |
|
154 | - */ |
|
155 | - public function getGoogleRequiredSchema(): array |
|
156 | - { |
|
157 | - return ['description', 'name']; |
|
158 | - } |
|
159 | - |
|
160 | - |
|
161 | - /** |
|
162 | - * @inheritdoc |
|
163 | - */ |
|
164 | - public function getGoogleRecommendedSchema(): array |
|
165 | - { |
|
166 | - return ['image', 'url']; |
|
167 | - } |
|
168 | - |
|
169 | - |
|
170 | - /** |
|
171 | - * @inheritdoc |
|
172 | - */ |
|
173 | - public function defineRules(): array |
|
174 | - { |
|
175 | - $rules = parent::defineRules(); |
|
176 | - $rules = array_merge($rules, [ |
|
177 | - [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
178 | - [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
179 | - [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
180 | - ]); |
|
181 | - |
|
182 | - return $rules; |
|
183 | - } |
|
26 | + use VeinTrait; |
|
27 | + use VesselTrait; |
|
28 | + use AnatomicalStructureTrait; |
|
29 | + use MedicalEntityTrait; |
|
30 | + use ThingTrait; |
|
31 | + |
|
32 | + /** |
|
33 | + * The Schema.org Type Name |
|
34 | + * |
|
35 | + * @var string |
|
36 | + */ |
|
37 | + public static string $schemaTypeName = 'Vein'; |
|
38 | + |
|
39 | + /** |
|
40 | + * The Schema.org Type Scope |
|
41 | + * |
|
42 | + * @var string |
|
43 | + */ |
|
44 | + public static string $schemaTypeScope = 'https://schema.org/Vein'; |
|
45 | + |
|
46 | + /** |
|
47 | + * The Schema.org Type Extends |
|
48 | + * |
|
49 | + * @var string |
|
50 | + */ |
|
51 | + public static string $schemaTypeExtends = 'Vessel'; |
|
52 | + |
|
53 | + /** |
|
54 | + * The Schema.org Type Description |
|
55 | + * |
|
56 | + * @var string |
|
57 | + */ |
|
58 | + public static string $schemaTypeDescription = 'A type of blood vessel that specifically carries blood to the heart.'; |
|
59 | + |
|
60 | + |
|
61 | + /** |
|
62 | + * @inheritdoc |
|
63 | + */ |
|
64 | + public function getSchemaPropertyNames(): array |
|
65 | + { |
|
66 | + return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
67 | + } |
|
68 | + |
|
69 | + |
|
70 | + /** |
|
71 | + * @inheritdoc |
|
72 | + */ |
|
73 | + public function getSchemaPropertyExpectedTypes(): array |
|
74 | + { |
|
75 | + return [ |
|
76 | + 'additionalType' => ['URL'], |
|
77 | + 'alternateName' => ['Text'], |
|
78 | + 'associatedPathophysiology' => ['Text'], |
|
79 | + 'bodyLocation' => ['Text'], |
|
80 | + 'code' => ['MedicalCode'], |
|
81 | + 'connectedTo' => ['AnatomicalStructure'], |
|
82 | + 'description' => ['Text'], |
|
83 | + 'diagram' => ['ImageObject'], |
|
84 | + 'disambiguatingDescription' => ['Text'], |
|
85 | + 'drainsTo' => ['Vessel'], |
|
86 | + 'funding' => ['Grant'], |
|
87 | + 'guideline' => ['MedicalGuideline'], |
|
88 | + 'identifier' => ['PropertyValue', 'URL', 'Text'], |
|
89 | + 'image' => ['URL', 'ImageObject'], |
|
90 | + 'legalStatus' => ['Text', 'DrugLegalStatus', 'MedicalEnumeration'], |
|
91 | + 'mainEntityOfPage' => ['URL', 'CreativeWork'], |
|
92 | + 'medicineSystem' => ['MedicineSystem'], |
|
93 | + 'name' => ['Text'], |
|
94 | + 'partOfSystem' => ['AnatomicalSystem'], |
|
95 | + 'potentialAction' => ['Action'], |
|
96 | + 'recognizingAuthority' => ['Organization'], |
|
97 | + 'regionDrained' => ['AnatomicalSystem', 'AnatomicalStructure'], |
|
98 | + 'relatedCondition' => ['MedicalCondition'], |
|
99 | + 'relatedTherapy' => ['MedicalTherapy'], |
|
100 | + 'relevantSpecialty' => ['MedicalSpecialty'], |
|
101 | + 'sameAs' => ['URL'], |
|
102 | + 'study' => ['MedicalStudy'], |
|
103 | + 'subStructure' => ['AnatomicalStructure'], |
|
104 | + 'subjectOf' => ['Event', 'CreativeWork'], |
|
105 | + 'tributary' => ['AnatomicalStructure'], |
|
106 | + 'url' => ['URL'] |
|
107 | + ]; |
|
108 | + } |
|
109 | + |
|
110 | + |
|
111 | + /** |
|
112 | + * @inheritdoc |
|
113 | + */ |
|
114 | + public function getSchemaPropertyDescriptions(): array |
|
115 | + { |
|
116 | + return [ |
|
117 | + '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.', |
|
118 | + 'alternateName' => 'An alias for the item.', |
|
119 | + 'associatedPathophysiology' => 'If applicable, a description of the pathophysiology associated with the anatomical system, including potential abnormal changes in the mechanical, physical, and biochemical functions of the system.', |
|
120 | + 'bodyLocation' => 'Location in the body of the anatomical structure.', |
|
121 | + 'code' => 'A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.', |
|
122 | + 'connectedTo' => 'Other anatomical structures to which this structure is connected.', |
|
123 | + 'description' => 'A description of the item.', |
|
124 | + 'diagram' => 'An image containing a diagram that illustrates the structure and/or its component substructures and/or connections with other structures.', |
|
125 | + '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.', |
|
126 | + 'drainsTo' => 'The vasculature that the vein drains into.', |
|
127 | + 'funding' => 'A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].', |
|
128 | + 'guideline' => 'A medical guideline related to this entity.', |
|
129 | + '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. ', |
|
130 | + 'image' => 'An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].', |
|
131 | + 'legalStatus' => 'The drug or supplement\'s legal status, including any controlled substance schedules that apply.', |
|
132 | + '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.', |
|
133 | + 'medicineSystem' => 'The system of medicine that includes this MedicalEntity, for example \'evidence-based\', \'homeopathic\', \'chiropractic\', etc.', |
|
134 | + 'name' => 'The name of the item.', |
|
135 | + 'partOfSystem' => 'The anatomical or organ system that this structure is part of.', |
|
136 | + 'potentialAction' => 'Indicates a potential Action, which describes an idealized action in which this thing would play an \'object\' role.', |
|
137 | + 'recognizingAuthority' => 'If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.', |
|
138 | + 'regionDrained' => 'The anatomical or organ system drained by this vessel; generally refers to a specific part of an organ.', |
|
139 | + 'relatedCondition' => 'A medical condition associated with this anatomy.', |
|
140 | + 'relatedTherapy' => 'A medical therapy related to this anatomy.', |
|
141 | + 'relevantSpecialty' => 'If applicable, a medical specialty in which this entity is relevant.', |
|
142 | + '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.', |
|
143 | + 'study' => 'A medical study or trial related to this entity.', |
|
144 | + 'subStructure' => 'Component (sub-)structure(s) that comprise this anatomical structure.', |
|
145 | + 'subjectOf' => 'A CreativeWork or Event about this Thing.', |
|
146 | + 'tributary' => 'The anatomical or organ system that the vein flows into; a larger structure that the vein connects to.', |
|
147 | + 'url' => 'URL of the item.' |
|
148 | + ]; |
|
149 | + } |
|
150 | + |
|
151 | + |
|
152 | + /** |
|
153 | + * @inheritdoc |
|
154 | + */ |
|
155 | + public function getGoogleRequiredSchema(): array |
|
156 | + { |
|
157 | + return ['description', 'name']; |
|
158 | + } |
|
159 | + |
|
160 | + |
|
161 | + /** |
|
162 | + * @inheritdoc |
|
163 | + */ |
|
164 | + public function getGoogleRecommendedSchema(): array |
|
165 | + { |
|
166 | + return ['image', 'url']; |
|
167 | + } |
|
168 | + |
|
169 | + |
|
170 | + /** |
|
171 | + * @inheritdoc |
|
172 | + */ |
|
173 | + public function defineRules(): array |
|
174 | + { |
|
175 | + $rules = parent::defineRules(); |
|
176 | + $rules = array_merge($rules, [ |
|
177 | + [$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
178 | + [$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
179 | + [$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
180 | + ]); |
|
181 | + |
|
182 | + return $rules; |
|
183 | + } |
|
184 | 184 | } |