Passed
Push — develop ( 674324...27f087 )
by Andrew
40:51 queued 22:51
created
src/seomatic-config/productmeta/JsonLdContainer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@
 block discarded – undo
19 19
  */
20 20
 
21 21
 return [
22
-    MetaJsonLdContainer::CONTAINER_TYPE . JsonLdService::GENERAL_HANDLE => [
22
+    MetaJsonLdContainer::CONTAINER_TYPE.JsonLdService::GENERAL_HANDLE => [
23 23
         'name' => 'General',
24 24
         'description' => 'JsonLd Tags',
25 25
         'handle' => JsonLdService::GENERAL_HANDLE,
26
-        'class' => (string)MetaJsonLdContainer::class,
26
+        'class' => (string) MetaJsonLdContainer::class,
27 27
         'include' => true,
28 28
         'dependencies' => [
29 29
         ],
Please login to merge, or discard this patch.
src/seomatic-config/eventmeta/TitleContainer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@
 block discarded – undo
19 19
  */
20 20
 
21 21
 return [
22
-    MetaTitleContainer::CONTAINER_TYPE . TitleService::GENERAL_HANDLE => [
22
+    MetaTitleContainer::CONTAINER_TYPE.TitleService::GENERAL_HANDLE => [
23 23
         'name' => 'General',
24 24
         'description' => 'Meta Title Tag',
25 25
         'handle' => TitleService::GENERAL_HANDLE,
26
-        'class' => (string)MetaTitleContainer::class,
26
+        'class' => (string) MetaTitleContainer::class,
27 27
         'include' => true,
28 28
         'dependencies' => [
29 29
         ],
Please login to merge, or discard this patch.
src/seomatic-config/eventmeta/JsonLdContainer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@
 block discarded – undo
19 19
  */
20 20
 
21 21
 return [
22
-    MetaJsonLdContainer::CONTAINER_TYPE . JsonLdService::GENERAL_HANDLE => [
22
+    MetaJsonLdContainer::CONTAINER_TYPE.JsonLdService::GENERAL_HANDLE => [
23 23
         'name' => 'General',
24 24
         'description' => 'JsonLd Tags',
25 25
         'handle' => JsonLdService::GENERAL_HANDLE,
26
-        'class' => (string)MetaJsonLdContainer::class,
26
+        'class' => (string) MetaJsonLdContainer::class,
27 27
         'include' => true,
28 28
         'dependencies' => [
29 29
         ],
Please login to merge, or discard this patch.
src/base/MetaItem.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                 // Add a URL to the schema.org type if this is a MetaJsonLD object
159 159
                 if ($isMetaJsonLdModel) {
160 160
                     /** @var  $this MetaJsonLd */
161
-                    $extraInfo = ' for http://schema.org/' . $this->type;
161
+                    $extraInfo = ' for http://schema.org/'.$this->type;
162 162
                 }
163 163
                 $errorMsg =
164 164
                     Craft::t('seomatic', 'Scenario: "')
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
                     . print_r($this->render(), true);
170 170
                 Craft::info($errorMsg, __METHOD__);
171 171
                 foreach ($this->errors as $param => $errors) {
172
-                    $errorMsg = Craft::t('seomatic', $errorLabel) . $param;
172
+                    $errorMsg = Craft::t('seomatic', $errorLabel).$param;
173 173
                     /** @var array $errors */
174 174
                     foreach ($errors as $error) {
175
-                        $errorMsg .= ' -> ' . $error;
175
+                        $errorMsg .= ' -> '.$error;
176 176
                         // Change the error level depending on the error message if this is a MetaJsonLD object
177 177
                         if ($isMetaJsonLdModel) {
178 178
                             if (strpos($error, 'recommended') !== false) {
@@ -185,15 +185,15 @@  discard block
 block discarded – undo
185 185
                             }
186 186
                         }
187 187
                     }
188
-                    Craft::info(strtoupper($logLevel) . ' - ' . $errorMsg, __METHOD__);
188
+                    Craft::info(strtoupper($logLevel).' - '.$errorMsg, __METHOD__);
189 189
                     // Extra debugging info for MetaJsonLd objects
190 190
                     if ($isMetaJsonLdModel) {
191 191
                         /** @var MetaJsonLd $className */
192 192
                         $className = \get_class($this);
193 193
                         if (!empty($className::$schemaPropertyDescriptions[$param])) {
194
-                            $errorMsg = Craft::t('seomatic', $errorLabel) . $param;
194
+                            $errorMsg = Craft::t('seomatic', $errorLabel).$param;
195 195
                             /** @var $className MetaJsonLd */
196
-                            $errorMsg .= ' -> ' . $className::$schemaPropertyDescriptions[$param];
196
+                            $errorMsg .= ' -> '.$className::$schemaPropertyDescriptions[$param];
197 197
                             Craft::info($errorMsg, __METHOD__);
198 198
                         }
199 199
                     }
Please login to merge, or discard this patch.
src/seoelements/SeoEvent.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         BaseEvent::on(
85 85
             CalendarsService::class,
86 86
             CalendarsService::EVENT_AFTER_SAVE,
87
-            function (SaveModelEvent $event) {
87
+            function(SaveModelEvent $event) {
88 88
                 Craft::debug(
89 89
                     'CalendarsService::EVENT_AFTER_DELETE',
90 90
                     __METHOD__
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         BaseEvent::on(
96 96
             CalendarsService::class,
97 97
             CalendarsService::EVENT_AFTER_DELETE,
98
-            function (DeleteModelEvent $event) {
98
+            function(DeleteModelEvent $event) {
99 99
                 Craft::debug(
100 100
                     'CalendarsService::EVENT_AFTER_DELETE',
101 101
                     __METHOD__
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             BaseEvent::on(
111 111
                 CalendarsService::class,
112 112
                 CalendarsService::EVENT_AFTER_SAVE,
113
-                function (SaveModelEvent $event) {
113
+                function(SaveModelEvent $event) {
114 114
                     Craft::debug(
115 115
                         'CalendarsService::EVENT_AFTER_SAVE',
116 116
                         __METHOD__
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
             BaseEvent::on(
136 136
                 CalendarsService::class,
137 137
                 CalendarsService::EVENT_AFTER_DELETE,
138
-                function (DeleteModelEvent $event) {
138
+                function(DeleteModelEvent $event) {
139 139
                     Craft::debug(
140 140
                         'CalendarsService::EVENT_AFTER_DELETE',
141 141
                         __METHOD__
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         // Install only for non-console Control Panel requests
166 166
         if ($request->getIsCpRequest() && !$request->getIsConsoleRequest()) {
167 167
             // Events sidebar
168
-            Seomatic::$view->hook('cp.solspace.calendar.events.edit.details', function (&$context) {
168
+            Seomatic::$view->hook('cp.solspace.calendar.events.edit.details', function(&$context) {
169 169
                 $html = '';
170 170
                 Seomatic::$view->registerAssetBundle(SeomaticAsset::class);
171 171
                 /** @var Event $event */
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
         $query = Event::find()
239 239
             ->setCalendar($metaBundle->sourceHandle)
240 240
             ->setLoadOccurrences(false)
241
-            ->siteId((int)$metaBundle->sourceSiteId)
242
-            ->limit((int)$metaBundle->metaSitemapVars->sitemapLimit);
241
+            ->siteId((int) $metaBundle->sourceSiteId)
242
+            ->limit((int) $metaBundle->metaSitemapVars->sitemapLimit);
243 243
 
244 244
         return $query;
245 245
     }
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
             ConfigHelper::getConfigFromFile(self::configFilePath()),
401 401
             [
402 402
                 'sourceId' => $sourceModel->id,
403
-                'sourceName' => (string)$sourceModel->name,
403
+                'sourceName' => (string) $sourceModel->name,
404 404
                 'sourceHandle' => $sourceModel->handle,
405 405
             ]
406 406
         );
Please login to merge, or discard this patch.
src/services/ServicesTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
         // Constants aren't allowed in traits until PHP >= 8.2
59 59
         $majorVersion = '3';
60 60
         // Dev server container name & port are based on the major version of this plugin
61
-        $devPort = 3000 + (int)$majorVersion;
62
-        $versionName = 'v' . $majorVersion;
61
+        $devPort = 3000 + (int) $majorVersion;
62
+        $versionName = 'v'.$majorVersion;
63 63
         // Merge in the passed config, so it our config can be overridden by Plugins::pluginConfigs['vite']
64 64
         // ref: https://github.com/craftcms/cms/issues/1989
65 65
         $config = ArrayHelper::merge([
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
                     'assetClass' => SeomaticAsset::class,
81 81
                     'checkDevServer' => true,
82 82
                     'class' => VitePluginService::class,
83
-                    'devServerInternal' => 'http://craft-seomatic-' . $versionName . '-buildchain-dev:' . $devPort,
84
-                    'devServerPublic' => 'http://localhost:' . $devPort,
83
+                    'devServerInternal' => 'http://craft-seomatic-'.$versionName.'-buildchain-dev:'.$devPort,
84
+                    'devServerPublic' => 'http://localhost:'.$devPort,
85 85
                     'errorEntry' => 'src/js/seomatic.js',
86 86
                     'useDevServer' => true,
87 87
                 ],
Please login to merge, or discard this patch.
src/services/Sitemaps.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/models/jsonld/MenuItem.php 1 patch
Indentation   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -23,130 +23,130 @@
 block discarded – undo
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 $schemaTypeName = 'MenuItem';
36
-
37
-	/**
38
-	 * The Schema.org Type Scope
39
-	 *
40
-	 * @var string
41
-	 */
42
-	public static $schemaTypeScope = 'https://schema.org/MenuItem';
43
-
44
-	/**
45
-	 * The Schema.org Type Extends
46
-	 *
47
-	 * @var string
48
-	 */
49
-	public static $schemaTypeExtends = 'Intangible';
50
-
51
-	/**
52
-	 * The Schema.org Type Description
53
-	 *
54
-	 * @var string
55
-	 */
56
-	public static $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 $schemaTypeName = 'MenuItem';
36
+
37
+    /**
38
+     * The Schema.org Type Scope
39
+     *
40
+     * @var string
41
+     */
42
+    public static $schemaTypeScope = 'https://schema.org/MenuItem';
43
+
44
+    /**
45
+     * The Schema.org Type Extends
46
+     *
47
+     * @var string
48
+     */
49
+    public static $schemaTypeExtends = 'Intangible';
50
+
51
+    /**
52
+     * The Schema.org Type Description
53
+     *
54
+     * @var string
55
+     */
56
+    public static $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
 }
Please login to merge, or discard this patch.
src/models/jsonld/Vein.php 1 patch
Indentation   +158 added lines, -158 removed lines patch added patch discarded remove patch
@@ -23,162 +23,162 @@
 block discarded – undo
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 $schemaTypeName = 'Vein';
38
-
39
-	/**
40
-	 * The Schema.org Type Scope
41
-	 *
42
-	 * @var string
43
-	 */
44
-	public static $schemaTypeScope = 'https://schema.org/Vein';
45
-
46
-	/**
47
-	 * The Schema.org Type Extends
48
-	 *
49
-	 * @var string
50
-	 */
51
-	public static $schemaTypeExtends = 'Vessel';
52
-
53
-	/**
54
-	 * The Schema.org Type Description
55
-	 *
56
-	 * @var string
57
-	 */
58
-	public static $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 $schemaTypeName = 'Vein';
38
+
39
+    /**
40
+     * The Schema.org Type Scope
41
+     *
42
+     * @var string
43
+     */
44
+    public static $schemaTypeScope = 'https://schema.org/Vein';
45
+
46
+    /**
47
+     * The Schema.org Type Extends
48
+     *
49
+     * @var string
50
+     */
51
+    public static $schemaTypeExtends = 'Vessel';
52
+
53
+    /**
54
+     * The Schema.org Type Description
55
+     *
56
+     * @var string
57
+     */
58
+    public static $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
 }
Please login to merge, or discard this patch.