@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | Event::on(MetaContainers::class, |
| 48 | 48 | MetaContainers::EVENT_METABUNDLE_DEBUG_DATA, |
| 49 | - function (MetaBundleDebugDataEvent $e) { |
|
| 49 | + function(MetaBundleDebugDataEvent $e) { |
|
| 50 | 50 | if ($e->metaBundle) { |
| 51 | 51 | $this->metaBundles[$e->metaBundleCategory] = $e->metaBundle; |
| 52 | 52 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function getSummary(): string |
| 69 | 69 | { |
| 70 | - return Craft::$app->getView()->render($this->viewPath . 'summary', ['panel' => $this]); |
|
| 70 | + return Craft::$app->getView()->render($this->viewPath.'summary', ['panel' => $this]); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function getDetail(): string |
| 77 | 77 | { |
| 78 | - return Craft::$app->getView()->render($this->viewPath . 'detail', ['panel' => $this]); |
|
| 78 | + return Craft::$app->getView()->render($this->viewPath.'detail', ['panel' => $this]); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -41,7 +41,10 @@ discard block |
||
| 41 | 41 | <tbody> |
| 42 | 42 | <?php foreach ($value as $subName => $subValue): ?> |
| 43 | 43 | <?php $meta['PROPERTY_NAME'] = [$subName]; ?> |
| 44 | - <?php if ($subName === '__errors') continue; ?> |
|
| 44 | + <?php if ($subName === '__errors') { |
|
| 45 | + continue; |
|
| 46 | +} |
|
| 47 | +?> |
|
| 45 | 48 | <tr> |
| 46 | 49 | <th class="seomatic-property"><?= Html::encode($subName) ?><?= $this->render('render-copy-menu', [ |
| 47 | 50 | 'value' => $subValue ?? '', |
@@ -53,5 +56,8 @@ discard block |
||
| 53 | 56 | ]) ?> |
| 54 | 57 | </tr> |
| 55 | 58 | <?php endforeach; ?></tbody></table><?php if (!empty($value['__errors'])): ?><?php foreach ($value['__errors'] as $logLevel => $errorCat): ?><?php if (!empty($errorCat)): ?><ul class="callout callout-<?= $logLevel ?> seomatic-error"><?php foreach ($errorCat as $property => $errors): ?><li class="seomatic-error <?= $logLevel ?>"><?= $property ?></li><ul><?php foreach (array_unique($errors) as $error): ?><li><?= $error ?></li><?php endforeach; ?></ul><?php endforeach; ?></ul><?php endif; ?><?php endforeach; ?><?php endif; ?></div></details></td> |
| 56 | -<?php else: ?><td><div class="callout callout-secondary seomatic-callout">not included</div></td> |
|
| 57 | -<?php endif; ?> |
|
| 59 | +<?php else { |
|
| 60 | + : ?><td><div class="callout callout-secondary seomatic-callout">not included</div></td> |
|
| 61 | +<?php endif; |
|
| 62 | +} |
|
| 63 | +?> |
|
@@ -164,7 +164,7 @@ |
||
| 164 | 164 | $content .= $this->render('rendered-tags', [ |
| 165 | 165 | 'values' => [ |
| 166 | 166 | 'renderedTags' => $panel->data[$metaBundleCategory]['renderedTags'][$metaContainerName] ?? [], |
| 167 | - 'id' => $sectionName . '-' . $metaBundleCategory . '-' . $metaContainerName . '-rendered-tags', |
|
| 167 | + 'id' => $sectionName.'-'.$metaBundleCategory.'-'.$metaContainerName.'-rendered-tags', |
|
| 168 | 168 | 'view' => $this, |
| 169 | 169 | 'language' => $editorLanguage, |
| 170 | 170 | ] |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | <th class="seomatic-property"><?= Html::encode($subName) ?><?= $this->render('render-copy-menu', [ |
| 24 | 24 | 'value' => $subValue ?? '', |
| 25 | 25 | 'meta' => $meta, |
| 26 | - ]) ?></th> |
|
| 26 | + ]) ?></th> |
|
| 27 | 27 | <?= $this->render('render-value', [ |
| 28 | 28 | 'value' => $subValue ?? '', |
| 29 | 29 | 'meta' => $meta, |
@@ -30,6 +30,9 @@ |
||
| 30 | 30 | ]) ?> |
| 31 | 31 | </tr> |
| 32 | 32 | <?php endforeach; ?></tbody></table></div></details></td> |
| 33 | -<?php else: ?><td><?= htmlspecialchars(VarDumper::dumpAsString($value), ENT_QUOTES | ENT_SUBSTITUTE, |
|
| 33 | +<?php else { |
|
| 34 | + : ?><td><?= htmlspecialchars(VarDumper::dumpAsString($value), ENT_QUOTES | ENT_SUBSTITUTE, |
|
| 34 | 35 | \Yii::$app->charset, true) ?></td> |
| 35 | -<?php endif; ?> |
|
| 36 | +<?php endif; |
|
| 37 | +} |
|
| 38 | +?> |
|
@@ -10,7 +10,8 @@ discard block |
||
| 10 | 10 | <h3><?= $caption ?></h3> |
| 11 | 11 | <?php if (empty($values['unparsed'])): ?> |
| 12 | 12 | <div class="callout callout-secondary seomatic-callout">no tags present</div> |
| 13 | -<?php else: ?> |
|
| 13 | +<?php else { |
|
| 14 | + : ?> |
|
| 14 | 15 | <div class="table-responsive"> |
| 15 | 16 | <table class="table table-condensed table-bordered table-striped table-hover seomatic-vars-table" |
| 16 | 17 | style="table-layout: fixed;"> |
@@ -23,7 +24,9 @@ discard block |
||
| 23 | 24 | </thead> |
| 24 | 25 | <tbody> |
| 25 | 26 | <?php foreach ($values['unparsed'] as $name => $value): ?> |
| 26 | - <?php $meta['TAG_NAME'] = $name; ?> |
|
| 27 | + <?php $meta['TAG_NAME'] = $name; |
|
| 28 | +} |
|
| 29 | +?> |
|
| 27 | 30 | <?php $meta['PROPERTY_NAME'] = []; ?> |
| 28 | 31 | <tr> |
| 29 | 32 | <th class="seomatic-property"><?= Html::encode($name) ?><?= $this->render('render-copy-menu', [ |
@@ -11,7 +11,8 @@ discard block |
||
| 11 | 11 | <h3><?= $caption ?></h3> |
| 12 | 12 | <?php if (empty($values['unparsed'])): ?> |
| 13 | 13 | <div class="callout callout-secondary seomatic-callout">no variables present</div> |
| 14 | -<?php else: ?> |
|
| 14 | +<?php else { |
|
| 15 | + : ?> |
|
| 15 | 16 | <div class="table-responsive"> |
| 16 | 17 | <table class="table table-condensed table-bordered table-striped table-hover seomatic-vars-table" |
| 17 | 18 | style="table-layout: fixed;"> |
@@ -39,7 +40,9 @@ discard block |
||
| 39 | 40 | 'meta' => $meta, |
| 40 | 41 | ]) ?> |
| 41 | 42 | </tr> |
| 42 | - <?php endforeach; ?> |
|
| 43 | + <?php endforeach; |
|
| 44 | +} |
|
| 45 | +?> |
|
| 43 | 46 | </tbody> |
| 44 | 47 | </table> |
| 45 | 48 | </div> |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $className = MetaTag::class; |
| 80 | 80 | if ($tagType) { |
| 81 | 81 | // Potentially load a sub-type of MetaTag |
| 82 | - $tagClassName = 'nystudio107\\seomatic\\models\\metatag\\' . ucfirst($tagType) . 'Tag'; |
|
| 82 | + $tagClassName = 'nystudio107\\seomatic\\models\\metatag\\'.ucfirst($tagType).'Tag'; |
|
| 83 | 83 | /** @var $model MetaTag */ |
| 84 | 84 | if (class_exists($tagClassName)) { |
| 85 | 85 | $className = $tagClassName; |
@@ -155,10 +155,10 @@ discard block |
||
| 155 | 155 | if (Seomatic::$devMode) { |
| 156 | 156 | $error = Craft::t( |
| 157 | 157 | 'seomatic', |
| 158 | - '{tagtype} tag `{key}` did not render because it is missing attributes. ' . print_r($data, true), |
|
| 158 | + '{tagtype} tag `{key}` did not render because it is missing attributes. '.print_r($data, true), |
|
| 159 | 159 | ['tagtype' => 'Meta', 'key' => $this->key] |
| 160 | 160 | ); |
| 161 | - Craft::info('WARNING - ' . $error, __METHOD__); |
|
| 161 | + Craft::info('WARNING - '.$error, __METHOD__); |
|
| 162 | 162 | } |
| 163 | 163 | $shouldRender = false; |
| 164 | 164 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | foreach ($configs as $config) { |
| 183 | 183 | if ($this->prepForRender($config)) { |
| 184 | 184 | ksort($config); |
| 185 | - $html .= Html::tag('meta', '', $config) . $linebreak; |
|
| 185 | + $html .= Html::tag('meta', '', $config).$linebreak; |
|
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $className = MetaLink::class; |
| 86 | 86 | if ($tagType) { |
| 87 | 87 | // Potentially load a sub-type of MetaTag |
| 88 | - $tagClassName = 'nystudio107\\seomatic\\models\\metalink\\' . ucfirst($tagType) . 'Link'; |
|
| 88 | + $tagClassName = 'nystudio107\\seomatic\\models\\metalink\\'.ucfirst($tagType).'Link'; |
|
| 89 | 89 | /** @var $model MetaLink */ |
| 90 | 90 | if (class_exists($tagClassName)) { |
| 91 | 91 | $className = $tagClassName; |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | '{tagtype} tag `{key}` did not render because it is missing attributes.', |
| 183 | 183 | ['tagtype' => 'Link', 'key' => $this->key] |
| 184 | 184 | ); |
| 185 | - Craft::info('WARNING - ' . $error, __METHOD__); |
|
| 185 | + Craft::info('WARNING - '.$error, __METHOD__); |
|
| 186 | 186 | } |
| 187 | 187 | $shouldRender = false; |
| 188 | 188 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | foreach ($configs as $config) { |
| 207 | 207 | if ($this->prepForRender($config)) { |
| 208 | 208 | ksort($config); |
| 209 | - $html .= Html::tag('link', '', $config) . $linebreak; |
|
| 209 | + $html .= Html::tag('link', '', $config).$linebreak; |
|
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | |
@@ -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); |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | foreach ($dataToValidate as $key => $data) { |
| 386 | 386 | /** @var array $expectedTypes */ |
| 387 | 387 | foreach ($expectedTypes as $expectedType) { |
| 388 | - $className = 'nystudio107\\seomatic\\models\\jsonld\\' . $expectedType; |
|
| 388 | + $className = 'nystudio107\\seomatic\\models\\jsonld\\'.$expectedType; |
|
| 389 | 389 | switch ($expectedType) { |
| 390 | 390 | // Text always validates |
| 391 | 391 | case 'Text': |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | case 'Date': |
| 426 | 426 | $validator = new DateValidator; |
| 427 | 427 | $validator->type = DateValidator::TYPE_DATE; |
| 428 | - $validator->format = 'php:' . DateTime::ATOM; |
|
| 428 | + $validator->format = 'php:'.DateTime::ATOM; |
|
| 429 | 429 | if ($validator->validate($data, $error)) { |
| 430 | 430 | $validated = true; |
| 431 | 431 | } |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | $validated = true; |
| 472 | 472 | } |
| 473 | 473 | if (is_string($data)) { |
| 474 | - $targetClass = 'nystudio107\\seomatic\\models\\jsonld\\' . $data; |
|
| 474 | + $targetClass = 'nystudio107\\seomatic\\models\\jsonld\\'.$data; |
|
| 475 | 475 | if (class_exists($targetClass)) { |
| 476 | 476 | $validated = true; |
| 477 | 477 | } |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | } |
| 481 | 481 | } |
| 482 | 482 | if (!$validated) { |
| 483 | - $this->addError($attribute, 'Must be one of these types: ' . implode(', ', $expectedTypes)); |
|
| 483 | + $this->addError($attribute, 'Must be one of these types: '.implode(', ', $expectedTypes)); |
|
| 484 | 484 | } |
| 485 | 485 | } |
| 486 | 486 | } |