@@ -56,7 +56,7 @@ |
||
| 56 | 56 | } |
| 57 | 57 | $tagData = $cache->getOrSet( |
| 58 | 58 | self::CONTAINER_TYPE.$uniqueKey, |
| 59 | - function () use ($uniqueKey) { |
|
| 59 | + function() use ($uniqueKey) { |
|
| 60 | 60 | Craft::info( |
| 61 | 61 | self::CONTAINER_TYPE.' cache miss: '.$uniqueKey, |
| 62 | 62 | __METHOD__ |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | // Constants |
| 36 | 36 | // ========================================================================= |
| 37 | 37 | |
| 38 | - const FRONTENDTEMPLATES_CONTAINER = Seomatic::SEOMATIC_HANDLE . EditableTemplate::TEMPLATE_TYPE; |
|
| 38 | + const FRONTENDTEMPLATES_CONTAINER = Seomatic::SEOMATIC_HANDLE.EditableTemplate::TEMPLATE_TYPE; |
|
| 39 | 39 | |
| 40 | 40 | const HUMANS_TXT_HANDLE = 'humans'; |
| 41 | 41 | const ROBOTS_TXT_HANDLE = 'robots'; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | Event::on( |
| 111 | 111 | UrlManager::class, |
| 112 | 112 | UrlManager::EVENT_REGISTER_SITE_URL_RULES, |
| 113 | - function (RegisterUrlRulesEvent $event) { |
|
| 113 | + function(RegisterUrlRulesEvent $event) { |
|
| 114 | 114 | Craft::debug( |
| 115 | 115 | 'UrlManager::EVENT_REGISTER_SITE_URL_RULES', |
| 116 | 116 | __METHOD__ |
@@ -165,16 +165,16 @@ discard block |
||
| 165 | 165 | $dependency = new TagDependency([ |
| 166 | 166 | 'tags' => [ |
| 167 | 167 | self::GLOBAL_FRONTENDTEMPLATE_CACHE_TAG, |
| 168 | - self::FRONTENDTEMPLATE_CACHE_TAG . $template, |
|
| 169 | - self::FRONTENDTEMPLATE_CACHE_TAG . $template . $siteId, |
|
| 168 | + self::FRONTENDTEMPLATE_CACHE_TAG.$template, |
|
| 169 | + self::FRONTENDTEMPLATE_CACHE_TAG.$template.$siteId, |
|
| 170 | 170 | ], |
| 171 | 171 | ]); |
| 172 | 172 | $cache = Craft::$app->getCache(); |
| 173 | 173 | $html = $cache->getOrSet( |
| 174 | - self::CACHE_KEY . $template . $siteId, |
|
| 175 | - function () use ($template, $params) { |
|
| 174 | + self::CACHE_KEY.$template.$siteId, |
|
| 175 | + function() use ($template, $params) { |
|
| 176 | 176 | Craft::info( |
| 177 | - 'Frontend template cache miss: ' . $template, |
|
| 177 | + 'Frontend template cache miss: '.$template, |
|
| 178 | 178 | __METHOD__ |
| 179 | 179 | ); |
| 180 | 180 | $html = ''; |
@@ -245,9 +245,9 @@ discard block |
||
| 245 | 245 | public function invalidateFrontendTemplateCache(string $template) |
| 246 | 246 | { |
| 247 | 247 | $cache = Craft::$app->getCache(); |
| 248 | - TagDependency::invalidate($cache, self::FRONTENDTEMPLATE_CACHE_TAG . $template); |
|
| 248 | + TagDependency::invalidate($cache, self::FRONTENDTEMPLATE_CACHE_TAG.$template); |
|
| 249 | 249 | Craft::info( |
| 250 | - 'Frontend template cache cleared: ' . $template, |
|
| 250 | + 'Frontend template cache cleared: '.$template, |
|
| 251 | 251 | __METHOD__ |
| 252 | 252 | ); |
| 253 | 253 | } |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | array $params = [], |
| 67 | 67 | string $minifier = null |
| 68 | 68 | ): string { |
| 69 | - $template = 'seomatic/' . $templatePath; |
|
| 69 | + $template = 'seomatic/'.$templatePath; |
|
| 70 | 70 | $oldMode = Craft::$app->view->getTemplateMode(); |
| 71 | 71 | // Look for the template on the frontend first |
| 72 | 72 | try { |
@@ -99,16 +99,16 @@ |
||
| 99 | 99 | { |
| 100 | 100 | // Enforce types |
| 101 | 101 | if ($this->sitemapUrls !== null) { |
| 102 | - $this->sitemapUrls = (bool)$this->sitemapUrls; |
|
| 102 | + $this->sitemapUrls = (bool) $this->sitemapUrls; |
|
| 103 | 103 | } |
| 104 | 104 | if ($this->sitemapAssets !== null) { |
| 105 | - $this->sitemapAssets = (bool)$this->sitemapAssets; |
|
| 105 | + $this->sitemapAssets = (bool) $this->sitemapAssets; |
|
| 106 | 106 | } |
| 107 | 107 | if ($this->sitemapFiles !== null) { |
| 108 | - $this->sitemapFiles = (bool)$this->sitemapFiles; |
|
| 108 | + $this->sitemapFiles = (bool) $this->sitemapFiles; |
|
| 109 | 109 | } |
| 110 | 110 | if ($this->sitemapAltLinks !== null) { |
| 111 | - $this->sitemapAltLinks = (bool)$this->sitemapAltLinks; |
|
| 111 | + $this->sitemapAltLinks = (bool) $this->sitemapAltLinks; |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | ]; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - array_walk($containerItems, function (&$contents, $type) use ($typeMap) { |
|
| 60 | + array_walk($containerItems, function(&$contents, $type) use ($typeMap) { |
|
| 61 | 61 | $contents = [ |
| 62 | 62 | 'filename' => $typeMap[$type], |
| 63 | 63 | 'contents' => $contents |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | // If either of the source bundle arguments are present, get the sitemap |
| 56 | - if (!empty($arguments['sourceBundleType']) || !empty($arguments['sourceBundleHandle'])) { |
|
| 56 | + if (!empty($arguments['sourceBundleType']) || !empty($arguments['sourceBundleHandle'])) { |
|
| 57 | 57 | $filename = self::createFilenameFromComponents($site->groupId, $arguments['sourceBundleType'] ?? '', $arguments['sourceBundleHandle'] ?? '', $siteId); |
| 58 | 58 | |
| 59 | 59 | return [ |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | 'name' => static::getName(), |
| 81 | 81 | 'fields' => self::class.'::getFieldDefinitions', |
| 82 | 82 | 'description' => 'This is the interface implemented by SEOmatic.', |
| 83 | - 'resolveType' => function (array $value) { |
|
| 83 | + 'resolveType' => function(array $value) { |
|
| 84 | 84 | return GqlEntityRegistry::getEntity(SeomaticGenerator::getName()); |
| 85 | 85 | }, |
| 86 | 86 | ])); |
@@ -119,27 +119,27 @@ discard block |
||
| 119 | 119 | 'name' => 'sitemaps', |
| 120 | 120 | 'args' => SitemapArguments::getArguments(), |
| 121 | 121 | 'type' => Type::listOf(FileContentsType::getType()), |
| 122 | - 'resolve' => SitemapResolver::class .'::getSitemaps' |
|
| 122 | + 'resolve' => SitemapResolver::class.'::getSitemaps' |
|
| 123 | 123 | ]; |
| 124 | 124 | |
| 125 | 125 | $fields['sitemapIndexes'] = [ |
| 126 | 126 | 'name' => 'sitemapIndexes', |
| 127 | 127 | 'args' => SitemapIndexArguments::getArguments(), |
| 128 | 128 | 'type' => Type::listOf(FileContentsType::getType()), |
| 129 | - 'resolve' => SitemapResolver::class .'::getSitemapIndexes' |
|
| 129 | + 'resolve' => SitemapResolver::class.'::getSitemapIndexes' |
|
| 130 | 130 | ]; |
| 131 | 131 | |
| 132 | 132 | $fields['sitemapStyles'] = [ |
| 133 | 133 | 'name' => 'sitemapStyles', |
| 134 | 134 | 'type' => FileContentsType::getType(), |
| 135 | - 'resolve' => SitemapResolver::class .'::getSitemapStyles' |
|
| 135 | + 'resolve' => SitemapResolver::class.'::getSitemapStyles' |
|
| 136 | 136 | ]; |
| 137 | 137 | |
| 138 | 138 | $fields['frontendTemplates'] = [ |
| 139 | 139 | 'name' => 'frontendTemplates', |
| 140 | 140 | 'args' => FrontendContainerArguments::getArguments(), |
| 141 | 141 | 'type' => Type::listOf(FileContentsType::getType()), |
| 142 | - 'resolve' => FrontendContainerResolver::class .'::getContainerFiles' |
|
| 142 | + 'resolve' => FrontendContainerResolver::class.'::getContainerFiles' |
|
| 143 | 143 | ]; |
| 144 | 144 | |
| 145 | 145 | return $fields; |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | 'name' => 'Frontend Templates', |
| 23 | 23 | 'description' => 'Templates that are rendered on the frontend', |
| 24 | 24 | 'handle' => FrontendTemplates::FRONTENDTEMPLATES_CONTAINER, |
| 25 | - 'class' => (string)FrontendTemplateContainer::class, |
|
| 25 | + 'class' => (string) FrontendTemplateContainer::class, |
|
| 26 | 26 | 'include' => true, |
| 27 | 27 | 'data' => [ |
| 28 | 28 | FrontendTemplates::HUMANS_TXT_HANDLE => [ |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | { |
| 85 | 85 | if ($pageInfo !== null && $pageInfo->currentPage !== null) { |
| 86 | 86 | // Let the meta containers know that this page is paginated |
| 87 | - Seomatic::$plugin->metaContainers->paginationPage = (string)$pageInfo->currentPage; |
|
| 87 | + Seomatic::$plugin->metaContainers->paginationPage = (string) $pageInfo->currentPage; |
|
| 88 | 88 | // See if we should strip the query params |
| 89 | 89 | $stripQueryParams = true; |
| 90 | 90 | $pageTrigger = Craft::$app->getConfig()->getGeneral()->pageTrigger; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | if (is_array($content)) { |
| 158 | 158 | $headerValue = ''; |
| 159 | 159 | foreach ($content as $contentVal) { |
| 160 | - $headerValue .= ($contentVal . ','); |
|
| 160 | + $headerValue .= ($contentVal.','); |
|
| 161 | 161 | } |
| 162 | 162 | $headerValue = rtrim($headerValue, ','); |
| 163 | 163 | } else { |
@@ -176,11 +176,11 @@ discard block |
||
| 176 | 176 | if (is_array($href)) { |
| 177 | 177 | $headerValue = ''; |
| 178 | 178 | foreach ($href as $hrefVal) { |
| 179 | - $headerValue .= ('<' . $hrefVal . '>' . ','); |
|
| 179 | + $headerValue .= ('<'.$hrefVal.'>'.','); |
|
| 180 | 180 | } |
| 181 | 181 | $headerValue = rtrim($headerValue, ','); |
| 182 | 182 | } else { |
| 183 | - $headerValue = '<' . $href . '>'; |
|
| 183 | + $headerValue = '<'.$href.'>'; |
|
| 184 | 184 | } |
| 185 | 185 | $headerValue .= "; rel='canonical'"; |
| 186 | 186 | $response->headers->add('Link', $headerValue); |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | if (is_array($content)) { |
| 197 | 197 | $headerValue = ''; |
| 198 | 198 | foreach ($content as $contentVal) { |
| 199 | - $headerValue .= ($contentVal . ','); |
|
| 199 | + $headerValue .= ($contentVal.','); |
|
| 200 | 200 | } |
| 201 | 201 | $headerValue = rtrim($headerValue, ','); |
| 202 | 202 | } else { |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | if ($lastElement && $element) { |
| 383 | 383 | if ($lastElement->uri !== '__home__' && $element->uri) { |
| 384 | 384 | $path = $lastElement->uri; |
| 385 | - $segments = array_values(array_filter(explode('/', $path), function ($segment) { |
|
| 385 | + $segments = array_values(array_filter(explode('/', $path), function($segment) { |
|
| 386 | 386 | return $segment !== ''; |
| 387 | 387 | })); |
| 388 | 388 | } |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | $element = $elements->getElementByUri($url, $site->id, false); |
| 543 | 543 | } |
| 544 | 544 | if ($element !== null) { |
| 545 | - if (isset($element->enabledForSite) && !(bool)$element->enabledForSite) { |
|
| 545 | + if (isset($element->enabledForSite) && !(bool) $element->enabledForSite) { |
|
| 546 | 546 | $includeUrl = false; |
| 547 | 547 | } |
| 548 | 548 | /** @var MetaBundle $metaBundle */ |
@@ -795,7 +795,7 @@ discard block |
||
| 795 | 795 | if (isset($value[$day][$time]) |
| 796 | 796 | && ($date = DateTimeHelper::toDateTime($value[$day][$time])) !== false |
| 797 | 797 | ) { |
| 798 | - $normalized[$day][$time] = (array)($date); |
|
| 798 | + $normalized[$day][$time] = (array) ($date); |
|
| 799 | 799 | } else { |
| 800 | 800 | $normalized[$day][$time] = null; |
| 801 | 801 | } |