@@ -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; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | '{tagtype} tag `{key}` did not render because it is missing attributes.', |
182 | 182 | ['tagtype' => 'Link', 'key' => $this->key] |
183 | 183 | ); |
184 | - Craft::info('WARNING - ' . $error, __METHOD__); |
|
184 | + Craft::info('WARNING - '.$error, __METHOD__); |
|
185 | 185 | } |
186 | 186 | $shouldRender = false; |
187 | 187 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | public static function create($schemaType, array $config = []): MetaJsonLd |
119 | 119 | { |
120 | 120 | // Try the passed in $schemaType |
121 | - $className = self::SCHEMA_NAMESPACE_PREFIX . $schemaType; |
|
121 | + $className = self::SCHEMA_NAMESPACE_PREFIX.$schemaType; |
|
122 | 122 | /** @var $model MetaJsonLd */ |
123 | 123 | if (class_exists($className)) { |
124 | 124 | self::cleanProperties($className, $config); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | return new $className($config); |
127 | 127 | } |
128 | 128 | // Try the prefixed $schemaType |
129 | - $className = self::SCHEMA_NAMESPACE_PREFIX . self::SCHEMA_NAME_PREFIX . $schemaType; |
|
129 | + $className = self::SCHEMA_NAMESPACE_PREFIX.self::SCHEMA_NAME_PREFIX.$schemaType; |
|
130 | 130 | /** @var $model MetaJsonLd */ |
131 | 131 | if (class_exists($className)) { |
132 | 132 | self::cleanProperties($className, $config); |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | foreach ($dataToValidate as $data) { |
375 | 375 | /** @var array $expectedTypes */ |
376 | 376 | foreach ($expectedTypes as $expectedType) { |
377 | - $className = 'nystudio107\\seomatic\\models\\jsonld\\' . $expectedType; |
|
377 | + $className = 'nystudio107\\seomatic\\models\\jsonld\\'.$expectedType; |
|
378 | 378 | switch ($expectedType) { |
379 | 379 | // Text always validates |
380 | 380 | case 'Text': |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | } |
456 | 456 | } |
457 | 457 | if (!$validated) { |
458 | - $this->addError($attribute, 'Must be one of these types: ' . implode(', ', $expectedTypes)); |
|
458 | + $this->addError($attribute, 'Must be one of these types: '.implode(', ', $expectedTypes)); |
|
459 | 459 | } |
460 | 460 | } |
461 | 461 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $suffix = ''; |
126 | 126 | break; |
127 | 127 | } |
128 | - $lengthAdjust = mb_strlen($prefix . $suffix); |
|
128 | + $lengthAdjust = mb_strlen($prefix.$suffix); |
|
129 | 129 | // Truncate the twitter:title tag content |
130 | 130 | $truncLen = Seomatic::$settings->maxTitleLength - $lengthAdjust; |
131 | 131 | if ($truncLen < 0) { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | '…' |
139 | 139 | ); |
140 | 140 | } |
141 | - $data['content'] = $prefix . $data['content'] . $suffix; |
|
141 | + $data['content'] = $prefix.$data['content'].$suffix; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | return $shouldRender; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $suffix = ''; |
126 | 126 | break; |
127 | 127 | } |
128 | - $lengthAdjust = mb_strlen($prefix . $suffix); |
|
128 | + $lengthAdjust = mb_strlen($prefix.$suffix); |
|
129 | 129 | // Truncate the og:title tag content |
130 | 130 | $truncLen = Seomatic::$settings->maxTitleLength - $lengthAdjust; |
131 | 131 | if ($truncLen < 0) { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | '…' |
139 | 139 | ); |
140 | 140 | } |
141 | - $data['content'] = $prefix . $data['content'] . $suffix; |
|
141 | + $data['content'] = $prefix.$data['content'].$suffix; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | return $shouldRender; |
@@ -143,16 +143,16 @@ discard block |
||
143 | 143 | break; |
144 | 144 | } |
145 | 145 | // Handle the case of empty titles |
146 | - if ($prefix === (' ' . $separator . ' ')) { |
|
146 | + if ($prefix === (' '.$separator.' ')) { |
|
147 | 147 | $prefix = ''; |
148 | 148 | } |
149 | - if ($suffix === (' ' . $separator)) { |
|
149 | + if ($suffix === (' '.$separator)) { |
|
150 | 150 | $suffix = ''; |
151 | 151 | } |
152 | 152 | // Remove potential double spaces |
153 | 153 | $prefix = preg_replace('/\s+/', ' ', $prefix); |
154 | 154 | $suffix = preg_replace('/\s+/', ' ', $suffix); |
155 | - $lengthAdjust = mb_strlen($prefix . $suffix); |
|
155 | + $lengthAdjust = mb_strlen($prefix.$suffix); |
|
156 | 156 | // Parse the data |
157 | 157 | $scenario = $this->scenario; |
158 | 158 | $this->setScenario('render'); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | '…' |
172 | 172 | ); |
173 | 173 | } |
174 | - $data = $prefix . $data . $suffix; |
|
174 | + $data = $prefix.$data.$suffix; |
|
175 | 175 | } else { |
176 | 176 | // If no title is provided, just use the site name |
177 | 177 | $data = MetaValueHelper::parseString($this->siteName); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $data = trim($data); |
181 | 181 | // devMode |
182 | 182 | if (Seomatic::$devMode) { |
183 | - $data = Seomatic::$settings->devModeTitlePrefix . $data; |
|
183 | + $data = Seomatic::$settings->devModeTitlePrefix.$data; |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $lastSegment = end($segments); |
342 | 342 | $site = Craft::$app->getSites()->getSiteByHandle($lastSegment); |
343 | 343 | if ($site !== null) { |
344 | - $siteSuffix = '/' . $lastSegment; |
|
344 | + $siteSuffix = '/'.$lastSegment; |
|
345 | 345 | } |
346 | 346 | } |
347 | 347 | $currentUser = Craft::$app->getUser()->getIdentity(); |
@@ -349,31 +349,31 @@ discard block |
||
349 | 349 | if ($currentUser->can('seomatic:dashboard')) { |
350 | 350 | $subNavs['dashboard'] = [ |
351 | 351 | 'label' => Craft::t('seomatic', 'Dashboard'), |
352 | - 'url' => 'seomatic/dashboard' . $siteSuffix, |
|
352 | + 'url' => 'seomatic/dashboard'.$siteSuffix, |
|
353 | 353 | ]; |
354 | 354 | } |
355 | 355 | if ($currentUser->can('seomatic:global-meta')) { |
356 | 356 | $subNavs['global'] = [ |
357 | 357 | 'label' => Craft::t('seomatic', 'Global SEO'), |
358 | - 'url' => 'seomatic/global/general' . $siteSuffix, |
|
358 | + 'url' => 'seomatic/global/general'.$siteSuffix, |
|
359 | 359 | ]; |
360 | 360 | } |
361 | 361 | if ($currentUser->can('seomatic:content-meta')) { |
362 | 362 | $subNavs['content'] = [ |
363 | 363 | 'label' => Craft::t('seomatic', 'Content SEO'), |
364 | - 'url' => 'seomatic/content' . $siteSuffix, |
|
364 | + 'url' => 'seomatic/content'.$siteSuffix, |
|
365 | 365 | ]; |
366 | 366 | } |
367 | 367 | if ($currentUser->can('seomatic:site-settings')) { |
368 | 368 | $subNavs['site'] = [ |
369 | 369 | 'label' => Craft::t('seomatic', 'Site Settings'), |
370 | - 'url' => 'seomatic/site/identity' . $siteSuffix, |
|
370 | + 'url' => 'seomatic/site/identity'.$siteSuffix, |
|
371 | 371 | ]; |
372 | 372 | } |
373 | 373 | if ($currentUser->can('seomatic:tracking-scripts')) { |
374 | 374 | $subNavs['tracking'] = [ |
375 | 375 | 'label' => Craft::t('seomatic', 'Tracking Scripts'), |
376 | - 'url' => 'seomatic/tracking/gtag' . $siteSuffix, |
|
376 | + 'url' => 'seomatic/tracking/gtag'.$siteSuffix, |
|
377 | 377 | ]; |
378 | 378 | } |
379 | 379 | $editableSettings = true; |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | Event::on( |
419 | 419 | Plugins::class, |
420 | 420 | Plugins::EVENT_AFTER_INSTALL_PLUGIN, |
421 | - function (PluginEvent $event) { |
|
421 | + function(PluginEvent $event) { |
|
422 | 422 | if ($event->plugin === $this) { |
423 | 423 | // Invalidate our caches after we've been installed |
424 | 424 | $this->clearAllCaches(); |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | Event::on( |
440 | 440 | ClearCaches::class, |
441 | 441 | ClearCaches::EVENT_REGISTER_CACHE_OPTIONS, |
442 | - function (RegisterCacheOptionsEvent $event) { |
|
442 | + function(RegisterCacheOptionsEvent $event) { |
|
443 | 443 | Craft::debug( |
444 | 444 | 'ClearCaches::EVENT_REGISTER_CACHE_OPTIONS', |
445 | 445 | __METHOD__ |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | Event::on( |
456 | 456 | Plugins::class, |
457 | 457 | Plugins::EVENT_BEFORE_SAVE_PLUGIN_SETTINGS, |
458 | - function (PluginEvent $event) { |
|
458 | + function(PluginEvent $event) { |
|
459 | 459 | if ($event->plugin === $this && !Craft::$app->getDb()->getSupportsMb4()) { |
460 | 460 | // For all the emojis |
461 | 461 | $settingsModel = $this->getSettings(); |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | Event::on( |
486 | 486 | Plugins::class, |
487 | 487 | Plugins::EVENT_AFTER_LOAD_PLUGINS, |
488 | - function () { |
|
488 | + function() { |
|
489 | 489 | // Delay registering SEO Elements to give other plugins a chance to load first |
490 | 490 | $this->seoElements->getAllSeoElementTypes(false); |
491 | 491 | // Delay installing GQL handlers to give other plugins a chance to register their own first |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | Event::on( |
507 | 507 | Fields::class, |
508 | 508 | Fields::EVENT_REGISTER_FIELD_TYPES, |
509 | - static function (RegisterComponentTypesEvent $event) { |
|
509 | + static function(RegisterComponentTypesEvent $event) { |
|
510 | 510 | $event->types[] = SeoSettingsField::class; |
511 | 511 | $event->types[] = Seomatic_MetaField::class; |
512 | 512 | } |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | Event::on( |
516 | 516 | Elements::class, |
517 | 517 | Elements::EVENT_AFTER_SAVE_ELEMENT, |
518 | - static function (ElementEvent $event) { |
|
518 | + static function(ElementEvent $event) { |
|
519 | 519 | Craft::debug( |
520 | 520 | 'Elements::EVENT_AFTER_SAVE_ELEMENT', |
521 | 521 | __METHOD__ |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | Event::on( |
536 | 536 | Elements::class, |
537 | 537 | Elements::EVENT_AFTER_DELETE_ELEMENT, |
538 | - static function (ElementEvent $event) { |
|
538 | + static function(ElementEvent $event) { |
|
539 | 539 | Craft::debug( |
540 | 540 | 'Elements::EVENT_AFTER_DELETE_ELEMENT', |
541 | 541 | __METHOD__ |
@@ -554,19 +554,19 @@ discard block |
||
554 | 554 | Event::on( |
555 | 555 | Entry::class, |
556 | 556 | Element::EVENT_REGISTER_PREVIEW_TARGETS, |
557 | - static function (RegisterPreviewTargetsEvent $e) { |
|
557 | + static function(RegisterPreviewTargetsEvent $e) { |
|
558 | 558 | /** @var Element $element */ |
559 | 559 | $element = $e->sender; |
560 | 560 | if ($element->uri !== null) { |
561 | 561 | $e->previewTargets[] = [ |
562 | - 'label' => ' |