@@ -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']; |
@@ -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 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | Event::on( |
106 | 106 | CampaignTypesService::class, |
107 | 107 | CampaignTypesService::EVENT_AFTER_SAVE_CAMPAIGN_TYPE, |
108 | - function (CampaignTypeEvent $event) { |
|
108 | + function(CampaignTypeEvent $event) { |
|
109 | 109 | Craft::debug( |
110 | 110 | 'CampaignTypesService::EVENT_AFTER_SAVE_CAMPAIGN_TYPE', |
111 | 111 | __METHOD__ |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | Event::on( |
117 | 117 | CampaignTypesService::class, |
118 | 118 | CampaignTypesService::EVENT_AFTER_DELETE_CAMPAIGN_TYPE, |
119 | - function (CampaignTypeEvent $event) { |
|
119 | + function(CampaignTypeEvent $event) { |
|
120 | 120 | Craft::debug( |
121 | 121 | 'CampaignTypesService::EVENT_AFTER_DELETE_CAMPAIGN_TYPE', |
122 | 122 | __METHOD__ |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | Event::on( |
132 | 132 | CampaignTypesService::class, |
133 | 133 | CampaignTypesService::EVENT_AFTER_SAVE_CAMPAIGN_TYPE, |
134 | - function (CampaignTypeEvent $event) { |
|
134 | + function(CampaignTypeEvent $event) { |
|
135 | 135 | Craft::debug( |
136 | 136 | 'CampaignTypesService::EVENT_AFTER_SAVE_CAMPAIGN_TYPE', |
137 | 137 | __METHOD__ |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | Event::on( |
155 | 155 | CampaignTypesService::class, |
156 | 156 | CampaignTypesService::EVENT_AFTER_DELETE_CAMPAIGN_TYPE, |
157 | - function (CampaignTypeEvent $event) { |
|
157 | + function(CampaignTypeEvent $event) { |
|
158 | 158 | Craft::debug( |
159 | 159 | 'CampaignTypesService::EVENT_AFTER_DELETE_CAMPAIGN_TYPE', |
160 | 160 | __METHOD__ |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | Event::on( |
185 | 185 | CampaignElement::class, |
186 | 186 | CampaignElement::EVENT_DEFINE_SIDEBAR_HTML, |
187 | - static function (DefineHtmlEvent $event) { |
|
187 | + static function(DefineHtmlEvent $event) { |
|
188 | 188 | Craft::debug( |
189 | 189 | 'CampaignElement::EVENT_DEFINE_SIDEBAR_HTML', |
190 | 190 | __METHOD__ |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
388 | 388 | [ |
389 | 389 | 'sourceId' => $sourceModel->id, |
390 | - 'sourceName' => (string)$sourceModel->name, |
|
390 | + 'sourceName' => (string) $sourceModel->name, |
|
391 | 391 | 'sourceHandle' => $sourceModel->handle, |
392 | 392 | ] |
393 | 393 | ); |
@@ -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' => ' |