@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | $asset = self::assetFromAssetOrIdOrQuery($asset, $siteId); |
| 189 | 189 | if (($asset !== null) && ($asset instanceof Asset)) { |
| 190 | - $width = (string)$asset->getWidth($transform); |
|
| 190 | + $width = (string) $asset->getWidth($transform); |
|
| 191 | 191 | if ($width === null) { |
| 192 | 192 | $width = ''; |
| 193 | 193 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | } |
| 220 | 220 | $asset = self::assetFromAssetOrIdOrQuery($asset, $siteId); |
| 221 | 221 | if (($asset !== null) && ($asset instanceof Asset)) { |
| 222 | - $height = (string)$asset->getHeight($transform); |
|
| 222 | + $height = (string) $asset->getHeight($transform); |
|
| 223 | 223 | if ($height === null) { |
| 224 | 224 | $height = ''; |
| 225 | 225 | } |
@@ -244,13 +244,13 @@ discard block |
||
| 244 | 244 | if (\is_array($assetIds)) { |
| 245 | 245 | foreach ($assetIds as $assetId) { |
| 246 | 246 | if (!empty($assetId)) { |
| 247 | - $assets[] = $elements->getElementById((int)$assetId, Asset::class, $siteId); |
|
| 247 | + $assets[] = $elements->getElementById((int) $assetId, Asset::class, $siteId); |
|
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | } else { |
| 251 | 251 | $assetId = $assetIds; |
| 252 | 252 | if (!empty($assetId)) { |
| 253 | - $assets[] = $elements->getElementById((int)$assetId, Asset::class, $siteId); |
|
| 253 | + $assets[] = $elements->getElementById((int) $assetId, Asset::class, $siteId); |
|
| 254 | 254 | } |
| 255 | 255 | } |
| 256 | 256 | } |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | return $asset->one(); |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | - $resolvedAssetId = (int)$asset; |
|
| 290 | + $resolvedAssetId = (int) $asset; |
|
| 291 | 291 | $resolvedSiteId = $siteId ?? 0; |
| 292 | 292 | if (isset(self::$cachedAssetsElements[$resolvedAssetId][$resolvedSiteId])) { |
| 293 | 293 | return self::$cachedAssetsElements[$resolvedAssetId][$resolvedSiteId]; |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | $value = StringHelper::encodeMb4($value); |
| 255 | 255 | } |
| 256 | 256 | if (\is_array($value)) { |
| 257 | - array_walk_recursive($value, function (&$arrayValue, $arrayKey) { |
|
| 257 | + array_walk_recursive($value, function(&$arrayValue, $arrayKey) { |
|
| 258 | 258 | if ($arrayValue !== null && \is_string($arrayValue)) { |
| 259 | 259 | $arrayValue = StringHelper::encodeMb4($arrayValue); |
| 260 | 260 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | if ($element !== null && $element->uri !== null) { |
| 391 | 391 | $siteId = $element->siteId; |
| 392 | 392 | $uri = $element->uri; |
| 393 | - $cacheKey = self::CACHE_KEY . $uri . $siteId . $this->elementDisplayPreviewType; |
|
| 393 | + $cacheKey = self::CACHE_KEY.$uri.$siteId.$this->elementDisplayPreviewType; |
|
| 394 | 394 | $metaBundleSourceType = Seomatic::$plugin->seoElements->getMetaBundleTypeFromElement($element); |
| 395 | 395 | $seoElement = Seomatic::$plugin->seoElements->getSeoElementByMetaBundleType($metaBundleSourceType); |
| 396 | 396 | $metaBundleSourceType = SeoEntry::getMetaBundleType(); |
@@ -401,15 +401,15 @@ discard block |
||
| 401 | 401 | $dependency = new TagDependency([ |
| 402 | 402 | 'tags' => [ |
| 403 | 403 | MetaContainers::GLOBAL_METACONTAINER_CACHE_TAG, |
| 404 | - MetaContainers::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId, |
|
| 405 | - MetaContainers::METACONTAINER_CACHE_TAG . $uri . $siteId, |
|
| 404 | + MetaContainers::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId, |
|
| 405 | + MetaContainers::METACONTAINER_CACHE_TAG.$uri.$siteId, |
|
| 406 | 406 | ], |
| 407 | 407 | ]); |
| 408 | 408 | $cache = Craft::$app->getCache(); |
| 409 | 409 | $cacheDuration = null; |
| 410 | 410 | $html = $cache->getOrSet( |
| 411 | - self::CACHE_KEY . $cacheKey, |
|
| 412 | - function () use ($uri, $siteId, $element) { |
|
| 411 | + self::CACHE_KEY.$cacheKey, |
|
| 412 | + function() use ($uri, $siteId, $element) { |
|
| 413 | 413 | Seomatic::$plugin->metaContainers->previewMetaContainers($uri, $siteId, true); |
| 414 | 414 | $variables = [ |
| 415 | 415 | 'previewTypes' => [ |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | ) |
| 452 | 452 | { |
| 453 | 453 | $variables['textFieldSources'] = array_merge( |
| 454 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'], |
|
| 454 | + ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'], |
|
| 455 | 455 | FieldHelper::fieldsOfTypeFromElement( |
| 456 | 456 | $element, |
| 457 | 457 | FieldHelper::TEXT_FIELD_CLASS_KEY, |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | ) |
| 460 | 460 | ); |
| 461 | 461 | $variables['assetFieldSources'] = array_merge( |
| 462 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields']], |
|
| 462 | + ['entryGroup' => ['optgroup' => $groupName.' Fields']], |
|
| 463 | 463 | FieldHelper::fieldsOfTypeFromElement( |
| 464 | 464 | $element, |
| 465 | 465 | FieldHelper::ASSET_FIELD_CLASS_KEY, |
@@ -19,11 +19,11 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | return [ |
| 22 | - MetaTitleContainer::CONTAINER_TYPE . TitleService::GENERAL_HANDLE => [ |
|
| 22 | + MetaTitleContainer::CONTAINER_TYPE.TitleService::GENERAL_HANDLE => [ |
|
| 23 | 23 | 'name' => 'General', |
| 24 | 24 | 'description' => 'Meta Title Tag', |
| 25 | 25 | 'handle' => TitleService::GENERAL_HANDLE, |
| 26 | - 'class' => (string)MetaTitleContainer::class, |
|
| 26 | + 'class' => (string) MetaTitleContainer::class, |
|
| 27 | 27 | 'include' => true, |
| 28 | 28 | 'dependencies' => [ |
| 29 | 29 | ], |
@@ -19,11 +19,11 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | return [ |
| 22 | - MetaJsonLdContainer::CONTAINER_TYPE . JsonLdService::GENERAL_HANDLE => [ |
|
| 22 | + MetaJsonLdContainer::CONTAINER_TYPE.JsonLdService::GENERAL_HANDLE => [ |
|
| 23 | 23 | 'name' => 'General', |
| 24 | 24 | 'description' => 'JsonLd Tags', |
| 25 | 25 | 'handle' => JsonLdService::GENERAL_HANDLE, |
| 26 | - 'class' => (string)MetaJsonLdContainer::class, |
|
| 26 | + 'class' => (string) MetaJsonLdContainer::class, |
|
| 27 | 27 | 'include' => true, |
| 28 | 28 | 'dependencies' => [ |
| 29 | 29 | ], |
@@ -21,11 +21,11 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | 23 | return [ |
| 24 | - MetaLinkContainer::CONTAINER_TYPE . LinkService::GENERAL_HANDLE => [ |
|
| 24 | + MetaLinkContainer::CONTAINER_TYPE.LinkService::GENERAL_HANDLE => [ |
|
| 25 | 25 | 'name' => 'General', |
| 26 | 26 | 'description' => 'Link Tags', |
| 27 | 27 | 'handle' => LinkService::GENERAL_HANDLE, |
| 28 | - 'class' => (string)MetaLinkContainer::class, |
|
| 28 | + 'class' => (string) MetaLinkContainer::class, |
|
| 29 | 29 | 'include' => true, |
| 30 | 30 | 'dependencies' => [ |
| 31 | 31 | ], |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | $baseUrl = UrlHelper::hostInfo(UrlHelper::siteUrl($path)); |
| 66 | 66 | |
| 67 | - return rtrim($baseUrl, '/') . '/' . ltrim($path, '/'); |
|
| 67 | + return rtrim($baseUrl, '/').'/'.ltrim($path, '/'); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | $metaSiteVars = Seomatic::$plugin->metaContainers->metaSiteVars; |
| 109 | 109 | if ($metaSiteVars && !empty($metaSiteVars->siteLinksQueryInput)) { |
| 110 | - $result = 'required name=' . $metaSiteVars->siteLinksQueryInput; |
|
| 110 | + $result = 'required name='.$metaSiteVars->siteLinksQueryInput; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | return $result; |
@@ -568,8 +568,8 @@ discard block |
||
| 568 | 568 | */ |
| 569 | 569 | public function isInherited(InheritableSettingsModel $settingCollection, $settingName) |
| 570 | 570 | { |
| 571 | - $explicitInherit = array_key_exists($settingName, (array)$settingCollection->inherited); |
|
| 572 | - $explicitOverride = array_key_exists($settingName, (array)$settingCollection->overrides); |
|
| 571 | + $explicitInherit = array_key_exists($settingName, (array) $settingCollection->inherited); |
|
| 572 | + $explicitOverride = array_key_exists($settingName, (array) $settingCollection->overrides); |
|
| 573 | 573 | |
| 574 | 574 | if ($explicitInherit || $explicitOverride) { |
| 575 | 575 | return $explicitInherit && !$explicitOverride; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function add($metaItem, string $handle = self::GENERAL_HANDLE) |
| 67 | 67 | { |
| 68 | - $key = MetaTitleContainer::CONTAINER_TYPE . $handle; |
|
| 68 | + $key = MetaTitleContainer::CONTAINER_TYPE.$handle; |
|
| 69 | 69 | Seomatic::$plugin->metaContainers->addToMetaContainer($metaItem, $key); |
| 70 | 70 | |
| 71 | 71 | /** @var MetaTitle $metaItem */ |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | public function container(string $handle = self::GENERAL_HANDLE) |
| 91 | 91 | { |
| 92 | - $key = MetaTitleContainer::CONTAINER_TYPE . $handle; |
|
| 92 | + $key = MetaTitleContainer::CONTAINER_TYPE.$handle; |
|
| 93 | 93 | |
| 94 | 94 | return Seomatic::$plugin->metaContainers->getMetaContainer($key); |
| 95 | 95 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function add($metaItem, string $handle = self::GENERAL_HANDLE) |
| 78 | 78 | { |
| 79 | - $key = MetaTagContainer::CONTAINER_TYPE . $handle; |
|
| 79 | + $key = MetaTagContainer::CONTAINER_TYPE.$handle; |
|
| 80 | 80 | Seomatic::$plugin->metaContainers->addToMetaContainer($metaItem, $key); |
| 81 | 81 | |
| 82 | 82 | /** @var MetaTag $metaItem */ |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function container(string $handle = self::GENERAL_HANDLE) |
| 102 | 102 | { |
| 103 | - $key = MetaTagContainer::CONTAINER_TYPE . $handle; |
|
| 103 | + $key = MetaTagContainer::CONTAINER_TYPE.$handle; |
|
| 104 | 104 | |
| 105 | 105 | return Seomatic::$plugin->metaContainers->getMetaContainer($key); |
| 106 | 106 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function add($metaItem, string $handle = self::GENERAL_HANDLE) |
| 67 | 67 | { |
| 68 | - $key = MetaScriptContainer::CONTAINER_TYPE . $handle; |
|
| 68 | + $key = MetaScriptContainer::CONTAINER_TYPE.$handle; |
|
| 69 | 69 | Seomatic::$plugin->metaContainers->addToMetaContainer($metaItem, $key); |
| 70 | 70 | |
| 71 | 71 | /** @var MetaScript $metaItem */ |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | public function container(string $handle = self::GENERAL_HANDLE) |
| 91 | 91 | { |
| 92 | - $key = MetaScriptContainer::CONTAINER_TYPE . $handle; |
|
| 92 | + $key = MetaScriptContainer::CONTAINER_TYPE.$handle; |
|
| 93 | 93 | |
| 94 | 94 | return Seomatic::$plugin->metaContainers->getMetaContainer($key); |
| 95 | 95 | } |