@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | if (!empty($string)) { |
| 74 | 74 | $string = HtmlPurifier::process($string, ['HTML.Allowed' => '']); |
| 75 | 75 | $string = html_entity_decode($string, ENT_NOQUOTES, 'UTF-8'); |
| 76 | - $result = (string)Stringy::create($string)->truncate($length, $substring); |
|
| 76 | + $result = (string) Stringy::create($string)->truncate($length, $substring); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | return $result; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | if (!empty($string)) { |
| 99 | 99 | $string = HtmlPurifier::process($string, ['HTML.Allowed' => '']); |
| 100 | 100 | $string = html_entity_decode($string, ENT_NOQUOTES, 'UTF-8'); |
| 101 | - $result = (string)Stringy::create($string)->safeTruncate($length, $substring); |
|
| 101 | + $result = (string) Stringy::create($string)->safeTruncate($length, $substring); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | return $result; |
@@ -132,9 +132,9 @@ discard block |
||
| 132 | 132 | $result = self::smartStripTags(Doxter::$plugin->getService()->parseMarkdown($field->getRaw())); |
| 133 | 133 | } else { |
| 134 | 134 | if (is_array($field)) { |
| 135 | - $result = self::smartStripTags((string)$field[0]); |
|
| 135 | + $result = self::smartStripTags((string) $field[0]); |
|
| 136 | 136 | } else { |
| 137 | - $result = self::smartStripTags((string)$field); |
|
| 137 | + $result = self::smartStripTags((string) $field); |
|
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $tags = $tags->all(); |
| 162 | 162 | } |
| 163 | 163 | foreach ($tags as $tag) { |
| 164 | - $result .= $tag->title . ', '; |
|
| 164 | + $result .= $tag->title.', '; |
|
| 165 | 165 | } |
| 166 | 166 | $result = rtrim($result, ', '); |
| 167 | 167 | |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | foreach ($fieldClasses as $fieldClassKey) { |
| 204 | 204 | if ($field instanceof $fieldClassKey) { |
| 205 | 205 | if ($field->handle === $fieldHandle || empty($fieldHandle)) { |
| 206 | - $result .= self::extractTextFromField($block[$field->handle]) . ' '; |
|
| 206 | + $result .= self::extractTextFromField($block[$field->handle]).' '; |
|
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | 209 | } |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | foreach ($fieldClasses as $fieldClassKey) { |
| 246 | 246 | if ($field instanceof $fieldClassKey) { |
| 247 | 247 | if ($field->handle === $fieldHandle || empty($fieldHandle)) { |
| 248 | - $result .= self::extractTextFromField($block[$field->handle]) . ' '; |
|
| 248 | + $result .= self::extractTextFromField($block[$field->handle]).' '; |
|
| 249 | 249 | } |
| 250 | 250 | } |
| 251 | 251 | } |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | foreach ($fieldClasses as $fieldClassKey) { |
| 295 | 295 | if ($field instanceof $fieldClassKey) { |
| 296 | 296 | if ($field->handle === $fieldHandle || empty($fieldHandle)) { |
| 297 | - $result .= self::extractTextFromField($block[$field->handle]) . ' '; |
|
| 297 | + $result .= self::extractTextFromField($block[$field->handle]).' '; |
|
| 298 | 298 | } |
| 299 | 299 | } |
| 300 | 300 | } |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | $str = html_entity_decode($str, ENT_NOQUOTES, 'UTF-8'); |
| 394 | 394 | $str = rawurldecode($str); |
| 395 | 395 | // Remove any linebreaks |
| 396 | - $str = (string)preg_replace("/\r|\n/", "", $str); |
|
| 396 | + $str = (string) preg_replace("/\r|\n/", "", $str); |
|
| 397 | 397 | $str = HtmlPurifier::process($str, ['HTML.Allowed' => '']); |
| 398 | 398 | $str = html_entity_decode($str, ENT_NOQUOTES, 'UTF-8'); |
| 399 | 399 | // Remove any embedded Twig code |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | $language = 'English'; |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | - $className = 'PhpScience\\TextRank\\Tool\\StopWords\\' . ucfirst($language); |
|
| 476 | + $className = 'PhpScience\\TextRank\\Tool\\StopWords\\'.ucfirst($language); |
|
| 477 | 477 | if (class_exists($className)) { |
| 478 | 478 | $stopWords = new $className(); |
| 479 | 479 | } |
@@ -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 | +?> |
|
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | * @param MetaBundle $metaBundle |
| 194 | 194 | * @param bool $forceUpdate |
| 195 | 195 | */ |
| 196 | - public function syncBundleWithConfig(MetaBundle &$metaBundle, bool $forceUpdate = false) |
|
| 196 | + public function syncBundleWithConfig(MetaBundle & $metaBundle, bool $forceUpdate = false) |
|
| 197 | 197 | { |
| 198 | 198 | $prevMetaBundle = $metaBundle; |
| 199 | 199 | $config = []; |
@@ -274,8 +274,8 @@ discard block |
||
| 274 | 274 | */ |
| 275 | 275 | public function updateMetaBundle(MetaBundle $metaBundle, int $siteId) |
| 276 | 276 | { |
| 277 | - $metaBundle->sourceName = (string)$metaBundle->sourceName; |
|
| 278 | - $metaBundle->sourceTemplate = (string)$metaBundle->sourceTemplate; |
|
| 277 | + $metaBundle->sourceName = (string) $metaBundle->sourceName; |
|
| 278 | + $metaBundle->sourceTemplate = (string) $metaBundle->sourceTemplate; |
|
| 279 | 279 | // Make sure it validates |
| 280 | 280 | if ($metaBundle->validate(null, true)) { |
| 281 | 281 | // Save it out to a record |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | 'sourceSiteId' => $siteId, |
| 286 | 286 | ]; |
| 287 | 287 | if ($metaBundle->typeId !== null) { |
| 288 | - $metaBundle->typeId = (int)$metaBundle->typeId; |
|
| 288 | + $metaBundle->typeId = (int) $metaBundle->typeId; |
|
| 289 | 289 | } |
| 290 | 290 | if (!empty($metaBundle->typeId)) { |
| 291 | 291 | $params['typeId'] = $metaBundle->typeId; |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | // The issue was that the containers were getting saved to the db with a hard-coded setting in them, because they'd |
| 303 | 303 | // been set that way by the environment, whereas to be changeable via the GUI, it needs to be set to {seomatic.meta.robots} |
| 304 | 304 | /** @var RobotsTag|null $robotsTag */ |
| 305 | - $robotsTag = $metaBundle->metaContainers[MetaTagContainer::CONTAINER_TYPE . TagService::GENERAL_HANDLE]->data['robots'] ?? null; |
|
| 305 | + $robotsTag = $metaBundle->metaContainers[MetaTagContainer::CONTAINER_TYPE.TagService::GENERAL_HANDLE]->data['robots'] ?? null; |
|
| 306 | 306 | if (!empty($robotsTag)) { |
| 307 | 307 | $robotsTag->content = $robotsTag->environment['live']['content'] ?? '{seomatic.meta.robots}'; |
| 308 | 308 | } |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | $metaBundleDefaults = ArrayHelper::merge( |
| 381 | 381 | $seoElement::metaBundleConfig($sourceModel), |
| 382 | 382 | [ |
| 383 | - 'sourceTemplate' => (string)$siteSetting->template, |
|
| 383 | + 'sourceTemplate' => (string) $siteSetting->template, |
|
| 384 | 384 | 'sourceSiteId' => $siteSetting->siteId, |
| 385 | 385 | 'sourceAltSiteSettings' => $siteSettingsArray, |
| 386 | 386 | 'sourceDateUpdated' => $dateUpdated, |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | public function getMetaBundleBySourceHandle(string $sourceBundleType, string $sourceHandle, int $sourceSiteId, $typeId = null) |
| 429 | 429 | { |
| 430 | 430 | $metaBundle = null; |
| 431 | - $typeId = (int)$typeId; |
|
| 431 | + $typeId = (int) $typeId; |
|
| 432 | 432 | // See if we have the meta bundle cached |
| 433 | 433 | if (!empty($this->metaBundlesBySourceHandle[$sourceBundleType][$sourceHandle][$sourceSiteId][$typeId])) { |
| 434 | 434 | $id = $this->metaBundlesBySourceHandle[$sourceBundleType][$sourceHandle][$sourceSiteId][$typeId]; |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | /** @var Section|CategoryGroup|ProductType $sourceModel */ |
| 516 | 516 | $sourceModel = $seoElement::sourceModelFromId($sourceId); |
| 517 | 517 | if ($sourceModel !== null) { |
| 518 | - $metaBundle->sourceName = (string)$sourceModel->name; |
|
| 518 | + $metaBundle->sourceName = (string) $sourceModel->name; |
|
| 519 | 519 | $metaBundle->sourceHandle = $sourceModel->handle; |
| 520 | 520 | } |
| 521 | 521 | } |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | public function getMetaBundleBySourceId(string $sourceBundleType, int $sourceId, ?int $sourceSiteId, $typeId = null) |
| 557 | 557 | { |
| 558 | 558 | $metaBundle = null; |
| 559 | - $typeId = (int)$typeId; |
|
| 559 | + $typeId = (int) $typeId; |
|
| 560 | 560 | // See if we have the meta bundle cached |
| 561 | 561 | if (!empty($this->metaBundlesBySourceId[$sourceBundleType][$sourceId][$sourceSiteId][$typeId])) { |
| 562 | 562 | $id = $this->metaBundlesBySourceId[$sourceBundleType][$sourceId][$sourceSiteId][$typeId]; |
@@ -750,7 +750,7 @@ discard block |
||
| 750 | 750 | ->from(['{{%seomatic_metabundles}}']) |
| 751 | 751 | ->where(['=', 'sourceBundleType', $seoElement::META_BUNDLE_TYPE]); |
| 752 | 752 | |
| 753 | - if ((int)$sourceSiteId !== 0) { |
|
| 753 | + if ((int) $sourceSiteId !== 0) { |
|
| 754 | 754 | $subQuery->andWhere(['sourceSiteId' => $sourceSiteId]); |
| 755 | 755 | } |
| 756 | 756 | if ($filter !== '') { |
@@ -787,7 +787,7 @@ discard block |
||
| 787 | 787 | public function getContentMetaBundleForElement(Element $element) |
| 788 | 788 | { |
| 789 | 789 | $source = $this->getMetaSourceFromElement($element); |
| 790 | - $key = implode(".", $source) . '.' . $element->siteId; |
|
| 790 | + $key = implode(".", $source).'.'.$element->siteId; |
|
| 791 | 791 | |
| 792 | 792 | if (empty($this->elementContentMetaBundles[$key])) { |
| 793 | 793 | $this->elementContentMetaBundles[$key] = $this->getMetaBundleBySourceId($source[1], $source[0], $element->siteId, $source[4]); |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | ->limit($metaBundle->metaSitemapVars->sitemapLimit); |
| 223 | 223 | if ($metaBundle->sourceType === 'structure' |
| 224 | 224 | && !empty($metaBundle->metaSitemapVars->structureDepth)) { |
| 225 | - $query->level($metaBundle->metaSitemapVars->structureDepth . '<='); |
|
| 225 | + $query->level($metaBundle->metaSitemapVars->structureDepth.'<='); |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | return $query; |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
| 390 | 390 | [ |
| 391 | 391 | 'sourceId' => $sourceModel->id, |
| 392 | - 'sourceName' => (string)$sourceModel->name, |
|
| 392 | + 'sourceName' => (string) $sourceModel->name, |
|
| 393 | 393 | 'sourceHandle' => $sourceModel->handle, |
| 394 | 394 | 'sourceType' => $sourceModel->type, |
| 395 | 395 | ] |
@@ -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 | ); |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | ->siteId($metaBundle->sourceSiteId) |
| 219 | 219 | ->limit($metaBundle->metaSitemapVars->sitemapLimit); |
| 220 | 220 | if (!empty($metaBundle->metaSitemapVars->structureDepth)) { |
| 221 | - $query->level($metaBundle->metaSitemapVars->structureDepth . '<='); |
|
| 221 | + $query->level($metaBundle->metaSitemapVars->structureDepth.'<='); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | return $query; |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
| 375 | 375 | [ |
| 376 | 376 | 'sourceId' => $sourceModel->id, |
| 377 | - 'sourceName' => (string)$sourceModel->name, |
|
| 377 | + 'sourceName' => (string) $sourceModel->name, |
|
| 378 | 378 | 'sourceHandle' => $sourceModel->handle, |
| 379 | 379 | ] |
| 380 | 380 | ); |
@@ -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 | } |