@@ -158,7 +158,7 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -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 | /** |
@@ -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 | ] |
@@ -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 |
@@ -51,16 +51,16 @@ |
||
51 | 51 | public function includeMetaData($dependency) |
52 | 52 | { |
53 | 53 | Craft::beginProfile('MetaJsonLdContainer::includeMetaData', __METHOD__); |
54 | - $uniqueKey = $this->handle . $dependency->tags[3] . '-v2'; |
|
54 | + $uniqueKey = $this->handle.$dependency->tags[3].'-v2'; |
|
55 | 55 | $cache = Craft::$app->getCache(); |
56 | 56 | if ($this->clearCache) { |
57 | 57 | TagDependency::invalidate($cache, $dependency->tags[3]); |
58 | 58 | } |
59 | 59 | [$jsonLd, $attrs] = $cache->getOrSet( |
60 | - self::CONTAINER_TYPE . $uniqueKey, |
|
61 | - function () use ($uniqueKey) { |
|
60 | + self::CONTAINER_TYPE.$uniqueKey, |
|
61 | + function() use ($uniqueKey) { |
|
62 | 62 | Craft::info( |
63 | - self::CONTAINER_TYPE . ' cache miss: ' . $uniqueKey, |
|
63 | + self::CONTAINER_TYPE.' cache miss: '.$uniqueKey, |
|
64 | 64 | __METHOD__ |
65 | 65 | ); |
66 | 66 |
@@ -55,16 +55,16 @@ discard block |
||
55 | 55 | public function includeMetaData($dependency) |
56 | 56 | { |
57 | 57 | Craft::beginProfile('MetaScriptContainer::includeMetaData', __METHOD__); |
58 | - $uniqueKey = $this->handle . $dependency->tags[3] . $this->dataLayerHash(); |
|
58 | + $uniqueKey = $this->handle.$dependency->tags[3].$this->dataLayerHash(); |
|
59 | 59 | $cache = Craft::$app->getCache(); |
60 | 60 | if ($this->clearCache) { |
61 | 61 | TagDependency::invalidate($cache, $dependency->tags[3]); |
62 | 62 | } |
63 | 63 | $tagData = $cache->getOrSet( |
64 | - self::CONTAINER_TYPE . $uniqueKey, |
|
65 | - function () use ($uniqueKey) { |
|
64 | + self::CONTAINER_TYPE.$uniqueKey, |
|
65 | + function() use ($uniqueKey) { |
|
66 | 66 | Craft::info( |
67 | - self::CONTAINER_TYPE . ' cache miss: ' . $uniqueKey, |
|
67 | + self::CONTAINER_TYPE.' cache miss: '.$uniqueKey, |
|
68 | 68 | __METHOD__ |
69 | 69 | ); |
70 | 70 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | 'jQuery(window).load()', |
141 | 141 | ]; |
142 | 142 | $position = $positionNames[$config['position'] - 1] ?? 'unknown'; |
143 | - $html .= "<!-- Position: {$position} -->" . PHP_EOL; |
|
143 | + $html .= "<!-- Position: {$position} -->".PHP_EOL; |
|
144 | 144 | } |
145 | 145 | if ($bodyJs || !$params['renderScriptTags']) { |
146 | 146 | $html .= $config['js']; |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | self::$cacheDuration = self::$devMode |
274 | 274 | ? self::DEVMODE_CACHE_DURATION |
275 | 275 | : self::$settings->metaCacheDuration ?? null; |
276 | - self::$cacheDuration = self::$cacheDuration === null ? null : (int)self::$cacheDuration; |
|
276 | + self::$cacheDuration = self::$cacheDuration === null ? null : (int) self::$cacheDuration; |
|
277 | 277 | self::$environment = EnvironmentHelper::determineEnvironment(); |
278 | 278 | MetaValueHelper::cache(); |
279 | 279 | // Version helpers |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | Event::on( |
349 | 349 | Plugins::class, |
350 | 350 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
351 | - function (PluginEvent $event) { |
|
351 | + function(PluginEvent $event) { |
|
352 | 352 | if ($event->plugin === $this) { |
353 | 353 | // Invalidate our caches after we've been installed |
354 | 354 | $this->clearAllCaches(); |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | Event::on( |
370 | 370 | ClearCaches::class, |
371 | 371 | ClearCaches::EVENT_REGISTER_CACHE_OPTIONS, |
372 | - function (RegisterCacheOptionsEvent $event) { |
|
372 | + function(RegisterCacheOptionsEvent $event) { |
|
373 | 373 | Craft::debug( |
374 | 374 | 'ClearCaches::EVENT_REGISTER_CACHE_OPTIONS', |
375 | 375 | __METHOD__ |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | Event::on( |
386 | 386 | Plugins::class, |
387 | 387 | Plugins::EVENT_BEFORE_SAVE_PLUGIN_SETTINGS, |
388 | - function (PluginEvent $event) { |
|
388 | + function(PluginEvent $event) { |
|
389 | 389 | if ($event->plugin === $this && !Craft::$app->getDb()->getSupportsMb4()) { |
390 | 390 | // For all the emojis |
391 | 391 | $settingsModel = $this->getSettings(); |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | Event::on( |
439 | 439 | Plugins::class, |
440 | 440 | Plugins::EVENT_AFTER_LOAD_PLUGINS, |
441 | - function () { |
|
441 | + function() { |
|
442 | 442 | // Delay registering SEO Elements to give other plugins a chance to load first |
443 | 443 | $this->seoElements->getAllSeoElementTypes(false); |
444 | 444 | // Delay installing GQL handlers to give other plugins a chance to register their own first |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | Event::on( |
460 | 460 | Fields::class, |
461 | 461 | Fields::EVENT_REGISTER_FIELD_TYPES, |
462 | - function (RegisterComponentTypesEvent $event) { |
|
462 | + function(RegisterComponentTypesEvent $event) { |
|
463 | 463 | $event->types[] = SeoSettingsField::class; |
464 | 464 | $event->types[] = Seomatic_MetaField::class; |
465 | 465 | } |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | Event::on( |
469 | 469 | Elements::class, |
470 | 470 | Elements::EVENT_AFTER_SAVE_ELEMENT, |
471 | - function (ElementEvent $event) { |
|
471 | + function(ElementEvent $event) { |
|
472 | 472 | Craft::debug( |
473 | 473 | 'Elements::EVENT_AFTER_SAVE_ELEMENT', |
474 | 474 | __METHOD__ |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | Event::on( |
489 | 489 | Elements::class, |
490 | 490 | Elements::EVENT_AFTER_DELETE_ELEMENT, |
491 | - function (ElementEvent $event) { |
|
491 | + function(ElementEvent $event) { |
|
492 | 492 | Craft::debug( |
493 | 493 | 'Elements::EVENT_AFTER_DELETE_ELEMENT', |
494 | 494 | __METHOD__ |
@@ -507,19 +507,19 @@ discard block |
||
507 | 507 | Event::on( |
508 | 508 | Entry::class, |
509 | 509 | Entry::EVENT_REGISTER_PREVIEW_TARGETS, |
510 | - function (RegisterPreviewTargetsEvent $e) { |
|
510 | + function(RegisterPreviewTargetsEvent $e) { |
|
511 | 511 | /** @var Element $element */ |
512 | 512 | $element = $e->sender; |
513 | 513 | if ($element->uri !== null) { |
514 | 514 | $e->previewTargets[] = [ |
515 | - 'label' => ' |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | { |
115 | 115 | $model = null; |
116 | 116 | |
117 | - $className = 'nystudio107\\seomatic\\models\\jsonld\\' . $schemaType; |
|
117 | + $className = 'nystudio107\\seomatic\\models\\jsonld\\'.$schemaType; |
|
118 | 118 | /** @var $model MetaJsonLd */ |
119 | 119 | if (class_exists($className)) { |
120 | 120 | self::cleanProperties($className, $config); |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | foreach ($dataToValidate as $key => $data) { |
374 | 374 | /** @var array $expectedTypes */ |
375 | 375 | foreach ($expectedTypes as $expectedType) { |
376 | - $className = 'nystudio107\\seomatic\\models\\jsonld\\' . $expectedType; |
|
376 | + $className = 'nystudio107\\seomatic\\models\\jsonld\\'.$expectedType; |
|
377 | 377 | switch ($expectedType) { |
378 | 378 | // Text always validates |
379 | 379 | case 'Text': |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | case 'Date': |
414 | 414 | $validator = new DateValidator; |
415 | 415 | $validator->type = DateValidator::TYPE_DATE; |
416 | - $validator->format = 'php:' . DateTime::ATOM; |
|
416 | + $validator->format = 'php:'.DateTime::ATOM; |
|
417 | 417 | if ($validator->validate($data, $error)) { |
418 | 418 | $validated = true; |
419 | 419 | } |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | $validated = true; |
460 | 460 | } |
461 | 461 | if (is_string($data)) { |
462 | - $targetClass = 'nystudio107\\seomatic\\models\\jsonld\\' . $data; |
|
462 | + $targetClass = 'nystudio107\\seomatic\\models\\jsonld\\'.$data; |
|
463 | 463 | if (class_exists($targetClass)) { |
464 | 464 | $validated = true; |
465 | 465 | } |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | } |
469 | 469 | } |
470 | 470 | if (!$validated) { |
471 | - $this->addError($attribute, 'Must be one of these types: ' . implode(', ', $expectedTypes)); |
|
471 | + $this->addError($attribute, 'Must be one of these types: '.implode(', ', $expectedTypes)); |
|
472 | 472 | } |
473 | 473 | } |
474 | 474 | } |