diff --git a/src/base/MetaItem.php b/src/base/MetaItem.php index 2618c9587..a36701c4b 100644 --- a/src/base/MetaItem.php +++ b/src/base/MetaItem.php @@ -148,8 +148,7 @@ public function renderAttributes(array $params = []): array public function debugMetaItem( $errorLabel = 'Error: ', array $scenarios = ['default' => 'error'] - ) - { + ) { $isMetaJsonLdModel = false; if (is_subclass_of($this, MetaJsonLd::class)) { $isMetaJsonLdModel = true; @@ -195,10 +194,9 @@ public function debugMetaItem( if ($isMetaJsonLdModel) { /** @var MetaJsonLd $className */ $className = get_class($this); - if (!empty($className::$schemaPropertyDescriptions[$param])) { + if (!empty($className->schemaPropertyDescriptions[$param])) { $errorMsg = Craft::t('seomatic', $errorLabel) . $param; - /** @var $className MetaJsonLd */ - $errorMsg .= ' -> ' . $className::$schemaPropertyDescriptions[$param]; + $errorMsg .= ' -> ' . $className->schemaPropertyDescriptions[$param]; Craft::info($errorMsg, __METHOD__); } } @@ -277,8 +275,7 @@ public function tagAttributesArray(): array public function validateStringOrArray( $attribute, $params - ) - { + ) { $validated = false; if (is_string($attribute)) { $validated = true; diff --git a/src/models/MetaJsonLd.php b/src/models/MetaJsonLd.php index 1e9fc6115..8a2fd7500 100644 --- a/src/models/MetaJsonLd.php +++ b/src/models/MetaJsonLd.php @@ -31,6 +31,12 @@ * @author nystudio107 * @package Seomatic * @since 3.0.0 + * + * @property-read array $googleRecommendedSchema + * @property-read array $googleRequiredSchema + * @property-read array $schemaPropertyDescriptions + * @property-read array $schemaPropertyExpectedTypes + * @property-read array $schemaPropertyNames */ class MetaJsonLd extends NonceItem { @@ -239,8 +245,7 @@ public function render( 'renderScriptTags' => true, 'array' => false, ] - ): string - { + ): string { $html = ''; $options = $this->tagAttributes(); if ($this->prepForRender($options)) { @@ -362,8 +367,7 @@ public function datetimeAttributes(): array public function validateJsonSchema( $attribute, $params - ) - { + ) { if (!in_array($attribute, $this->getSchemaPropertyNames(), true)) { $this->addError($attribute, 'The attribute does not exist.'); } else {