@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | ->limit($metaBundle->metaSitemapVars->sitemapLimit); |
223 | 223 | if ($metaBundle->sourceType === 'structure' |
224 | 224 | && !empty($metaBundle->metaSitemapVars->structureDepth)) { |
225 | - $query->level($metaBundle->metaSitemapVars->structureDepth . '<='); |
|
225 | + $query->level($metaBundle->metaSitemapVars->structureDepth.'<='); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | return $query; |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
390 | 390 | [ |
391 | 391 | 'sourceId' => $sourceModel->id, |
392 | - 'sourceName' => (string)$sourceModel->name, |
|
392 | + 'sourceName' => (string) $sourceModel->name, |
|
393 | 393 | 'sourceHandle' => $sourceModel->handle, |
394 | 394 | 'sourceType' => $sourceModel->type, |
395 | 395 | ] |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | $query |
242 | 242 | ->setCalendar($metaBundle->sourceHandle) |
243 | 243 | ->setLoadOccurrences(false) |
244 | - ->siteId((int)$metaBundle->sourceSiteId) |
|
245 | - ->limit((int)$metaBundle->metaSitemapVars->sitemapLimit); |
|
244 | + ->siteId((int) $metaBundle->sourceSiteId) |
|
245 | + ->limit((int) $metaBundle->metaSitemapVars->sitemapLimit); |
|
246 | 246 | |
247 | 247 | return $query; |
248 | 248 | } |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
406 | 406 | [ |
407 | 407 | 'sourceId' => $sourceModel->id, |
408 | - 'sourceName' => (string)$sourceModel->name, |
|
408 | + 'sourceName' => (string) $sourceModel->name, |
|
409 | 409 | 'sourceHandle' => $sourceModel->handle, |
410 | 410 | ] |
411 | 411 | ); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | ->siteId($metaBundle->sourceSiteId) |
219 | 219 | ->limit($metaBundle->metaSitemapVars->sitemapLimit); |
220 | 220 | if (!empty($metaBundle->metaSitemapVars->structureDepth)) { |
221 | - $query->level($metaBundle->metaSitemapVars->structureDepth . '<='); |
|
221 | + $query->level($metaBundle->metaSitemapVars->structureDepth.'<='); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | return $query; |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | ConfigHelper::getConfigFromFile(self::configFilePath()), |
375 | 375 | [ |
376 | 376 | 'sourceId' => $sourceModel->id, |
377 | - 'sourceName' => (string)$sourceModel->name, |
|
377 | + 'sourceName' => (string) $sourceModel->name, |
|
378 | 378 | 'sourceHandle' => $sourceModel->handle, |
379 | 379 | ] |
380 | 380 | ); |
@@ -67,7 +67,7 @@ |
||
67 | 67 | // Set the property |
68 | 68 | $value = $args[0]; |
69 | 69 | if (is_object($value) && $value instanceof Markup) { |
70 | - $value = (string)$value; |
|
70 | + $value = (string) $value; |
|
71 | 71 | } |
72 | 72 | $property->setValue($this, $value); |
73 | 73 |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | // Add a URL to the schema.org type if this is a MetaJsonLD object |
163 | 163 | if ($isMetaJsonLdModel) { |
164 | 164 | /** @var MetaJsonLd $this */ |
165 | - $extraInfo = ' for http://schema.org/' . $this->type; |
|
165 | + $extraInfo = ' for http://schema.org/'.$this->type; |
|
166 | 166 | } |
167 | 167 | $errorMsg = |
168 | 168 | Craft::t('seomatic', 'Scenario: "') |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | . print_r($this->render(), true); |
174 | 174 | Craft::info($errorMsg, __METHOD__); |
175 | 175 | foreach ($this->errors as $param => $errors) { |
176 | - $errorMsg = Craft::t('seomatic', $errorLabel) . $param; |
|
176 | + $errorMsg = Craft::t('seomatic', $errorLabel).$param; |
|
177 | 177 | /** @var array $errors */ |
178 | 178 | foreach ($errors as $error) { |
179 | - $errorMsg .= ' -> ' . $error; |
|
179 | + $errorMsg .= ' -> '.$error; |
|
180 | 180 | // Change the error level depending on the error message if this is a MetaJsonLD object |
181 | 181 | if ($isMetaJsonLdModel) { |
182 | 182 | if (strpos($error, 'recommended') !== false) { |
@@ -189,14 +189,14 @@ discard block |
||
189 | 189 | } |
190 | 190 | } |
191 | 191 | } |
192 | - Craft::info(strtoupper($logLevel) . ' - ' . $errorMsg, __METHOD__); |
|
192 | + Craft::info(strtoupper($logLevel).' - '.$errorMsg, __METHOD__); |
|
193 | 193 | // Extra debugging info for MetaJsonLd objects |
194 | 194 | if ($isMetaJsonLdModel) { |
195 | 195 | /** @var MetaJsonLd $className */ |
196 | 196 | $className = get_class($this); |
197 | 197 | if (!empty($className->schemaPropertyDescriptions[$param])) { |
198 | - $errorMsg = Craft::t('seomatic', $errorLabel) . $param; |
|
199 | - $errorMsg .= ' -> ' . $className->schemaPropertyDescriptions[$param]; |
|
198 | + $errorMsg = Craft::t('seomatic', $errorLabel).$param; |
|
199 | + $errorMsg .= ' -> '.$className->schemaPropertyDescriptions[$param]; |
|
200 | 200 | Craft::info($errorMsg, __METHOD__); |
201 | 201 | } |
202 | 202 | } |
@@ -238,10 +238,10 @@ |
||
238 | 238 | } |
239 | 239 | // Make sure these are strings |
240 | 240 | if (!empty($this->facebookProfileId)) { |
241 | - $this->facebookProfileId = (string)$this->facebookProfileId; |
|
241 | + $this->facebookProfileId = (string) $this->facebookProfileId; |
|
242 | 242 | } |
243 | 243 | if (!empty($this->facebookAppId)) { |
244 | - $this->facebookAppId = (string)$this->facebookAppId; |
|
244 | + $this->facebookAppId = (string) $this->facebookAppId; |
|
245 | 245 | } |
246 | 246 | // Identity |
247 | 247 | if (is_array($this->identity)) { |
@@ -46,12 +46,12 @@ discard block |
||
46 | 46 | $siteUrl = MetaValue::parseString($siteUrl); |
47 | 47 | // Extract out just the path part |
48 | 48 | $parts = self::decomposeUrl($path); |
49 | - $path = $parts['path'] . $parts['suffix']; |
|
49 | + $path = $parts['path'].$parts['suffix']; |
|
50 | 50 | $url = self::mergeUrlWithPath($siteUrl, $path); |
51 | 51 | // Handle trailing slashes properly for generated URLs |
52 | 52 | $generalConfig = Craft::$app->getConfig()->getGeneral(); |
53 | 53 | if ($generalConfig->addTrailingSlashesToUrls && !preg_match('/(.+\?.*)|(\.[^\/]+$)/', $url)) { |
54 | - $url = rtrim($url, '/') . '/'; |
|
54 | + $url = rtrim($url, '/').'/'; |
|
55 | 55 | } |
56 | 56 | if (!$generalConfig->addTrailingSlashesToUrls) { |
57 | 57 | $url = rtrim($url, '/'); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
87 | - return rtrim($url, '/') . '/' . ltrim(substr($path, $overlap), '/'); |
|
87 | + return rtrim($url, '/').'/'.ltrim(substr($path, $overlap), '/'); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | // Handle trailing slashes properly for generated URLs |
153 | 153 | $generalConfig = Craft::$app->getConfig()->getGeneral(); |
154 | 154 | if ($generalConfig->addTrailingSlashesToUrls && !preg_match('/(.+\?.*)|(\.[^\/]+$)/', $url)) { |
155 | - $url = rtrim($url, '/') . '/'; |
|
155 | + $url = rtrim($url, '/').'/'; |
|
156 | 156 | } |
157 | 157 | if (!$generalConfig->addTrailingSlashesToUrls) { |
158 | 158 | $url = rtrim($url, '/'); |
@@ -172,13 +172,13 @@ discard block |
||
172 | 172 | $urlParts = parse_url($url); |
173 | 173 | $encodedUrl = ""; |
174 | 174 | if (isset($urlParts['scheme'])) { |
175 | - $encodedUrl .= $urlParts['scheme'] . '://'; |
|
175 | + $encodedUrl .= $urlParts['scheme'].'://'; |
|
176 | 176 | } |
177 | 177 | if (isset($urlParts['host'])) { |
178 | 178 | $encodedUrl .= $urlParts['host']; |
179 | 179 | } |
180 | 180 | if (isset($urlParts['port'])) { |
181 | - $encodedUrl .= ':' . $urlParts['port']; |
|
181 | + $encodedUrl .= ':'.$urlParts['port']; |
|
182 | 182 | } |
183 | 183 | if (isset($urlParts['path'])) { |
184 | 184 | $encodedUrl .= $urlParts['path']; |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | foreach ($query as $j => $value) { |
189 | 189 | $value = explode('=', $value, 2); |
190 | 190 | if (count($value) === 2) { |
191 | - $query[$j] = urlencode($value[0]) . '=' . urlencode($value[1]); |
|
191 | + $query[$j] = urlencode($value[0]).'='.urlencode($value[1]); |
|
192 | 192 | } else { |
193 | 193 | $query[$j] = urlencode($value[0]); |
194 | 194 | } |
195 | 195 | } |
196 | - $encodedUrl .= '?' . implode('&', $query); |
|
196 | + $encodedUrl .= '?'.implode('&', $query); |
|
197 | 197 | } |
198 | 198 | if (isset($urlParts['fragment'])) { |
199 | - $encodedUrl .= '#' . $urlParts['fragment']; |
|
199 | + $encodedUrl .= '#'.$urlParts['fragment']; |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | return $encodedUrl; |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | if ($siteId !== null) { |
237 | 237 | $site = $sites->getSiteById($siteId, true); |
238 | 238 | if (!$site) { |
239 | - throw new Exception('Invalid site ID: ' . $siteId); |
|
239 | + throw new Exception('Invalid site ID: '.$siteId); |
|
240 | 240 | } |
241 | 241 | } |
242 | 242 | |
@@ -260,11 +260,11 @@ discard block |
||
260 | 260 | |
261 | 261 | if (filter_var($pathOrUrl, FILTER_VALIDATE_URL)) { |
262 | 262 | $url_parts = parse_url($pathOrUrl); |
263 | - $result['prefix'] = $url_parts['scheme'] . '://' . $url_parts['host']; |
|
263 | + $result['prefix'] = $url_parts['scheme'].'://'.$url_parts['host']; |
|
264 | 264 | $result['path'] = $url_parts['path'] ?? ''; |
265 | 265 | $result['suffix'] = ''; |
266 | - $result['suffix'] .= empty($url_parts['query']) ? '' : '?' . $url_parts['query']; |
|
267 | - $result['suffix'] .= empty($url_parts['fragment']) ? '' : '#' . $url_parts['fragment']; |
|
266 | + $result['suffix'] .= empty($url_parts['query']) ? '' : '?'.$url_parts['query']; |
|
267 | + $result['suffix'] .= empty($url_parts['fragment']) ? '' : '#'.$url_parts['fragment']; |
|
268 | 268 | } else { |
269 | 269 | $result['prefix'] = ''; |
270 | 270 | $result['path'] = $pathOrUrl; |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | if ($element !== null && $element->uri !== null) { |
377 | 377 | $siteId = $element->siteId; |
378 | 378 | $uri = $element->uri; |
379 | - $cacheKey = self::CACHE_KEY . $uri . $siteId . $this->elementDisplayPreviewType; |
|
379 | + $cacheKey = self::CACHE_KEY.$uri.$siteId.$this->elementDisplayPreviewType; |
|
380 | 380 | $metaBundleSourceType = Seomatic::$plugin->seoElements->getMetaBundleTypeFromElement($element); |
381 | 381 | $seoElement = Seomatic::$plugin->seoElements->getSeoElementByMetaBundleType($metaBundleSourceType); |
382 | 382 | $metaBundleSourceType = SeoEntry::getMetaBundleType(); |
@@ -387,14 +387,14 @@ discard block |
||
387 | 387 | $dependency = new TagDependency([ |
388 | 388 | 'tags' => [ |
389 | 389 | MetaContainers::GLOBAL_METACONTAINER_CACHE_TAG, |
390 | - MetaContainers::METACONTAINER_CACHE_TAG . $metaBundleSourceId . $metaBundleSourceType . $siteId, |
|
391 | - MetaContainers::METACONTAINER_CACHE_TAG . $uri . $siteId, |
|
390 | + MetaContainers::METACONTAINER_CACHE_TAG.$metaBundleSourceId.$metaBundleSourceType.$siteId, |
|
391 | + MetaContainers::METACONTAINER_CACHE_TAG.$uri.$siteId, |
|
392 | 392 | ], |
393 | 393 | ]); |
394 | 394 | $cache = Craft::$app->getCache(); |
395 | 395 | $cacheDuration = null; |
396 | 396 | $html = $cache->getOrSet( |
397 | - self::CACHE_KEY . $cacheKey, |
|
397 | + self::CACHE_KEY.$cacheKey, |
|
398 | 398 | function() use ($uri, $siteId, $element) { |
399 | 399 | Seomatic::$plugin->metaContainers->previewMetaContainers($uri, $siteId, true, true, $element); |
400 | 400 | $variables = [ |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | array &$variables |
437 | 437 | ) { |
438 | 438 | $variables['textFieldSources'] = array_merge( |
439 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields'], 'title' => 'Title'], |
|
439 | + ['entryGroup' => ['optgroup' => $groupName.' Fields'], 'title' => 'Title'], |
|
440 | 440 | FieldHelper::fieldsOfTypeFromElement( |
441 | 441 | $element, |
442 | 442 | FieldHelper::TEXT_FIELD_CLASS_KEY, |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | ) |
445 | 445 | ); |
446 | 446 | $variables['assetFieldSources'] = array_merge( |
447 | - ['entryGroup' => ['optgroup' => $groupName . ' Fields']], |
|
447 | + ['entryGroup' => ['optgroup' => $groupName.' Fields']], |
|
448 | 448 | FieldHelper::fieldsOfTypeFromElement( |
449 | 449 | $element, |
450 | 450 | FieldHelper::ASSET_FIELD_CLASS_KEY, |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function actionGenerate() |
70 | 70 | { |
71 | - echo 'Generating sitemap' . PHP_EOL; |
|
71 | + echo 'Generating sitemap'.PHP_EOL; |
|
72 | 72 | if ($this->siteId !== null) { |
73 | 73 | $siteIds[] = $this->siteId; |
74 | 74 | } else { |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $sitemap = SitemapTemplate::create(); |
116 | 116 | if ($site) { |
117 | 117 | for ($pageNum = 1; $pageNum <= $pageCount; $pageNum++) { |
118 | - echo sprintf('Generating page %d of %d' . PHP_EOL, $pageNum, $pageCount); |
|
118 | + echo sprintf('Generating page %d of %d'.PHP_EOL, $pageNum, $pageCount); |
|
119 | 119 | $sitemap->render([ |
120 | 120 | 'groupId' => $site->groupId, |
121 | 121 | 'siteId' => $metaBundle->sourceSiteId, |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | // Generate the sitemap so it is in the cache |
128 | 128 | } |
129 | 129 | |
130 | - echo '---' . PHP_EOL; |
|
130 | + echo '---'.PHP_EOL; |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 | } |