@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | public static function create($schemaType, array $config = []): MetaJsonLd |
120 | 120 | { |
121 | 121 | // Try the passed in $schemaType |
122 | - $className = self::SCHEMA_NAMESPACE_PREFIX . $schemaType; |
|
122 | + $className = self::SCHEMA_NAMESPACE_PREFIX.$schemaType; |
|
123 | 123 | /** @var $model MetaJsonLd */ |
124 | 124 | if (class_exists($className)) { |
125 | 125 | self::cleanProperties($className, $config); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | return new $className($config); |
128 | 128 | } |
129 | 129 | // Try the prefixed $schemaType |
130 | - $className = self::SCHEMA_NAMESPACE_PREFIX . self::SCHEMA_NAME_PREFIX . $schemaType; |
|
130 | + $className = self::SCHEMA_NAMESPACE_PREFIX.self::SCHEMA_NAME_PREFIX.$schemaType; |
|
131 | 131 | /** @var $model MetaJsonLd */ |
132 | 132 | if (class_exists($className)) { |
133 | 133 | self::cleanProperties($className, $config); |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | foreach ($dataToValidate as $key => $data) { |
384 | 384 | /** @var array $expectedTypes */ |
385 | 385 | foreach ($expectedTypes as $expectedType) { |
386 | - $className = 'nystudio107\\seomatic\\models\\jsonld\\' . $expectedType; |
|
386 | + $className = 'nystudio107\\seomatic\\models\\jsonld\\'.$expectedType; |
|
387 | 387 | switch ($expectedType) { |
388 | 388 | // Text always validates |
389 | 389 | case 'Text': |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | case 'Date': |
424 | 424 | $validator = new DateValidator(); |
425 | 425 | $validator->type = DateValidator::TYPE_DATE; |
426 | - $validator->format = 'php:' . DateTime::ATOM; |
|
426 | + $validator->format = 'php:'.DateTime::ATOM; |
|
427 | 427 | if ($validator->validate($data, $error)) { |
428 | 428 | $validated = true; |
429 | 429 | } |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | $validated = true; |
470 | 470 | } |
471 | 471 | if (is_string($data)) { |
472 | - $targetClass = 'nystudio107\\seomatic\\models\\jsonld\\' . $data; |
|
472 | + $targetClass = 'nystudio107\\seomatic\\models\\jsonld\\'.$data; |
|
473 | 473 | if (class_exists($targetClass)) { |
474 | 474 | $validated = true; |
475 | 475 | } |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | } |
479 | 479 | } |
480 | 480 | if (!$validated) { |
481 | - $this->addError($attribute, 'Must be one of these types: ' . implode(', ', $expectedTypes)); |
|
481 | + $this->addError($attribute, 'Must be one of these types: '.implode(', ', $expectedTypes)); |
|
482 | 482 | } |
483 | 483 | } |
484 | 484 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | if ($width === null) { |
198 | 198 | $width = ''; |
199 | 199 | } |
200 | - $width = (string)$width; |
|
200 | + $width = (string) $width; |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | return $width; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | if ($height === null) { |
230 | 230 | $height = ''; |
231 | 231 | } |
232 | - $height = (string)$height; |
|
232 | + $height = (string) $height; |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | return $height; |
@@ -251,12 +251,12 @@ discard block |
||
251 | 251 | if (is_array($assetIds)) { |
252 | 252 | foreach ($assetIds as $assetId) { |
253 | 253 | if (!empty($assetId)) { |
254 | - $assets[] = $elements->getElementById((int)$assetId, Asset::class, $siteId); |
|
254 | + $assets[] = $elements->getElementById((int) $assetId, Asset::class, $siteId); |
|
255 | 255 | } |
256 | 256 | } |
257 | 257 | } else { |
258 | 258 | $assetId = $assetIds; |
259 | - $assets[] = $elements->getElementById((int)$assetId, Asset::class, $siteId); |
|
259 | + $assets[] = $elements->getElementById((int) $assetId, Asset::class, $siteId); |
|
260 | 260 | } |
261 | 261 | } |
262 | 262 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | return $asset->one(); |
293 | 293 | } |
294 | 294 | |
295 | - $resolvedAssetId = (int)$asset; |
|
295 | + $resolvedAssetId = (int) $asset; |
|
296 | 296 | $resolvedSiteId = $siteId ?? 0; |
297 | 297 | if (isset(self::$cachedAssetsElements[$resolvedAssetId][$resolvedSiteId])) { |
298 | 298 | return self::$cachedAssetsElements[$resolvedAssetId][$resolvedSiteId]; |
@@ -55,7 +55,7 @@ |
||
55 | 55 | } elseif ($json === null || $json === '') { |
56 | 56 | return null; |
57 | 57 | } |
58 | - $decode = json_decode((string)$json, $asArray, 512, JSON_BIGINT_AS_STRING); |
|
58 | + $decode = json_decode((string) $json, $asArray, 512, JSON_BIGINT_AS_STRING); |
|
59 | 59 | static::handleJsonError(json_last_error()); |
60 | 60 | |
61 | 61 | return $decode; |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | $metaValue = Craft::t( |
295 | 295 | 'seomatic', |
296 | 296 | 'Error rendering `{template}` -> {error}', |
297 | - ['template' => $metaValue, 'error' => $e->getMessage() . ' - ' . print_r($metaValue, true)] |
|
297 | + ['template' => $metaValue, 'error' => $e->getMessage().' - '.print_r($metaValue, true)] |
|
298 | 298 | ); |
299 | 299 | Craft::error($metaValue, __METHOD__); |
300 | 300 | Craft::$app->getErrorHandler()->logException($e); |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | // Handle being passed in an object |
314 | 314 | if (is_object($metaValue)) { |
315 | 315 | if ($metaValue instanceof Markup) { |
316 | - return trim(html_entity_decode((string)$metaValue, ENT_NOQUOTES, 'UTF-8')); |
|
316 | + return trim(html_entity_decode((string) $metaValue, ENT_NOQUOTES, 'UTF-8')); |
|
317 | 317 | } |
318 | 318 | if ($metaValue instanceof Asset) { |
319 | 319 | return $metaValue->uri; |
@@ -75,8 +75,11 @@ |
||
75 | 75 | </ul><?php endif; ?><?php endforeach; ?><?php endif; ?></div> |
76 | 76 | </details> |
77 | 77 | </td> |
78 | -<?php else: ?> |
|
78 | +<?php else { |
|
79 | + : ?> |
|
79 | 80 | <td> |
80 | 81 | <div class="callout callout-secondary seomatic-callout">not included</div> |
81 | 82 | </td> |
82 | -<?php endif; ?> |
|
83 | +<?php endif; |
|
84 | +} |
|
85 | +?> |
@@ -45,7 +45,10 @@ |
||
45 | 45 | </div> |
46 | 46 | </details> |
47 | 47 | </td> |
48 | -<?php else: ?> |
|
48 | +<?php else { |
|
49 | + : ?> |
|
49 | 50 | <td><?= htmlspecialchars(VarDumper::dumpAsString($value), ENT_QUOTES | ENT_SUBSTITUTE, |
50 | 51 | Yii::$app->charset, true) ?></td> |
51 | -<?php endif; ?> |
|
52 | +<?php endif; |
|
53 | +} |
|
54 | +?> |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | $query |
242 | 242 | ->setCalendar($metaBundle->sourceHandle) |
243 | 243 | ->setLoadOccurrences(false) |
244 | - ->siteId((int)$metaBundle->sourceSiteId) |
|
245 | - ->limit((int)$metaBundle->metaSitemapVars->sitemapLimit); |
|
244 | + ->siteId((int) $metaBundle->sourceSiteId) |
|
245 | + ->limit((int) $metaBundle->metaSitemapVars->sitemapLimit); |
|
246 | 246 | |
247 | 247 | return $query; |
248 | 248 | } |
@@ -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 | ); |
@@ -67,7 +67,7 @@ |
||
67 | 67 | // Set the property |
68 | 68 | $value = $args[0]; |
69 | 69 | if (is_object($value) && $value instanceof Markup) { |
70 | - $value = (string)$value; |
|
70 | + $value = (string) $value; |
|
71 | 71 | } |
72 | 72 | $property->setValue($this, $value); |
73 | 73 |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | // Add a URL to the schema.org type if this is a MetaJsonLD object |
163 | 163 | if ($isMetaJsonLdModel) { |
164 | 164 | /** @var MetaJsonLd $this */ |
165 | - $extraInfo = ' for http://schema.org/' . $this->type; |
|
165 | + $extraInfo = ' for http://schema.org/'.$this->type; |
|
166 | 166 | } |
167 | 167 | $errorMsg = |
168 | 168 | Craft::t('seomatic', 'Scenario: "') |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | . print_r($this->render(), true); |
174 | 174 | Craft::info($errorMsg, __METHOD__); |
175 | 175 | foreach ($this->errors as $param => $errors) { |
176 | - $errorMsg = Craft::t('seomatic', $errorLabel) . $param; |
|
176 | + $errorMsg = Craft::t('seomatic', $errorLabel).$param; |
|
177 | 177 | /** @var array $errors */ |
178 | 178 | foreach ($errors as $error) { |
179 | - $errorMsg .= ' -> ' . $error; |
|
179 | + $errorMsg .= ' -> '.$error; |
|
180 | 180 | // Change the error level depending on the error message if this is a MetaJsonLD object |
181 | 181 | if ($isMetaJsonLdModel) { |
182 | 182 | if (strpos($error, 'recommended') !== false) { |
@@ -189,14 +189,14 @@ discard block |
||
189 | 189 | } |
190 | 190 | } |
191 | 191 | } |
192 | - Craft::info(strtoupper($logLevel) . ' - ' . $errorMsg, __METHOD__); |
|
192 | + Craft::info(strtoupper($logLevel).' - '.$errorMsg, __METHOD__); |
|
193 | 193 | // Extra debugging info for MetaJsonLd objects |
194 | 194 | if ($isMetaJsonLdModel) { |
195 | 195 | /** @var MetaJsonLd $className */ |
196 | 196 | $className = get_class($this); |
197 | 197 | if (!empty($className->schemaPropertyDescriptions[$param])) { |
198 | - $errorMsg = Craft::t('seomatic', $errorLabel) . $param; |
|
199 | - $errorMsg .= ' -> ' . $className->schemaPropertyDescriptions[$param]; |
|
198 | + $errorMsg = Craft::t('seomatic', $errorLabel).$param; |
|
199 | + $errorMsg .= ' -> '.$className->schemaPropertyDescriptions[$param]; |
|
200 | 200 | Craft::info($errorMsg, __METHOD__); |
201 | 201 | } |
202 | 202 | } |