@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | if (!empty($string)) { |
74 | 74 | $string = strip_tags($string); |
75 | - $result = (string)Stringy::create($string)->truncate($length, $substring); |
|
75 | + $result = (string) Stringy::create($string)->truncate($length, $substring); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | return $result; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | if (!empty($string)) { |
98 | 98 | $string = strip_tags($string); |
99 | - $result = (string)Stringy::create($string)->safeTruncate($length, $substring); |
|
99 | + $result = (string) Stringy::create($string)->safeTruncate($length, $substring); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | return $result; |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | $result = self::extractTextFromTags($field); |
129 | 129 | } else { |
130 | 130 | if (\is_array($field)) { |
131 | - $result = self::smartStripTags((string)$field[0]); |
|
131 | + $result = self::smartStripTags((string) $field[0]); |
|
132 | 132 | } else { |
133 | - $result = self::smartStripTags((string)$field); |
|
133 | + $result = self::smartStripTags((string) $field); |
|
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | |
337 | 337 | $result = \is_array($keywords) |
338 | 338 | ? implode(', ', \array_slice(array_keys($keywords), 0, $limit)) |
339 | - : (string)$keywords; |
|
339 | + : (string) $keywords; |
|
340 | 340 | |
341 | 341 | return self::sanitizeFieldData($result); |
342 | 342 | } |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | |
375 | 375 | $result = \is_array($sentences) |
376 | 376 | ? implode(' ', $sentences) |
377 | - : (string)$sentences; |
|
377 | + : (string) $sentences; |
|
378 | 378 | |
379 | 379 | return self::sanitizeFieldData($result); |
380 | 380 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $cspNonceType = self::getCspNonceType(); |
45 | 45 | if ($cspNonceType) { |
46 | 46 | $cspValue = "{$cspDirective} 'nonce-$nonce'"; |
47 | - foreach(self::CSP_HEADERS as $cspHeader) { |
|
47 | + foreach (self::CSP_HEADERS as $cspHeader) { |
|
48 | 48 | switch ($cspNonceType) { |
49 | 49 | case 'tag': |
50 | 50 | Craft::$app->getView()->registerMetaTag([ |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | ]); |
54 | 54 | break; |
55 | 55 | case 'header': |
56 | - Craft::$app->getResponse()->getHeaders()->add($cspHeader, $cspValue . ';'); |
|
56 | + Craft::$app->getResponse()->getHeaders()->add($cspHeader, $cspValue.';'); |
|
57 | 57 | break; |
58 | 58 | default: |
59 | 59 | break; |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | */ |
390 | 390 | protected function assetSitemapItem(Asset $asset, MetaBundle $metaBundle, array &$lines) |
391 | 391 | { |
392 | - if ((bool)$asset->enabled && $asset->getUrl() !== null) { |
|
392 | + if ((bool) $asset->enabled && $asset->getUrl() !== null) { |
|
393 | 393 | switch ($asset->kind) { |
394 | 394 | case 'image': |
395 | 395 | $lines[] = '<image:image>'; |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | */ |
438 | 438 | protected function assetFilesSitemapLink(Asset $asset, MetaBundle $metaBundle, array &$lines) |
439 | 439 | { |
440 | - if ((bool)$asset->enabled && $asset->getUrl() !== null) { |
|
440 | + if ((bool) $asset->enabled && $asset->getUrl() !== null) { |
|
441 | 441 | if (\in_array($asset->kind, SitemapTemplate::FILE_TYPES, false)) { |
442 | 442 | $dateUpdated = $asset->dateUpdated ?? $asset->dateCreated ?? new \DateTime; |
443 | 443 | $lines[] = '<url>'; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | { |
111 | 111 | if ($pageInfo !== null && $pageInfo->currentPage !== null) { |
112 | 112 | // Let the meta containers know that this page is paginated |
113 | - Seomatic::$plugin->metaContainers->paginationPage = (string)$pageInfo->currentPage; |
|
113 | + Seomatic::$plugin->metaContainers->paginationPage = (string) $pageInfo->currentPage; |
|
114 | 114 | // Set the current page |
115 | 115 | $url = $pageInfo->getPageUrl($pageInfo->currentPage); |
116 | 116 | $url = self::sanitizeUrl($url); |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | if ($lastElement && $element) { |
404 | 404 | if ($lastElement->uri !== '__home__' && $element->uri) { |
405 | 405 | $path = $lastElement->uri; |
406 | - $segments = array_values(array_filter(explode('/', $path), function ($segment) { |
|
406 | + $segments = array_values(array_filter(explode('/', $path), function($segment) { |
|
407 | 407 | return $segment !== ''; |
408 | 408 | })); |
409 | 409 | } |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | $element = $elements->getElementByUri($url, $site->id, false); |
573 | 573 | } |
574 | 574 | if ($element !== null) { |
575 | - if (!(bool)$element->enabled) { |
|
575 | + if (!(bool) $element->enabled) { |
|
576 | 576 | $includeUrl = false; |
577 | 577 | } |
578 | 578 | /** @var MetaBundle $metaBundle */ |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | if (isset($value[$day][$time]) |
689 | 689 | && ($date = DateTimeHelper::toDateTime($value[$day][$time])) !== false |
690 | 690 | ) { |
691 | - $normalized[$day][$time] = (array)($date); |
|
691 | + $normalized[$day][$time] = (array) ($date); |
|
692 | 692 | } else { |
693 | 693 | $normalized[$day][$time] = null; |
694 | 694 | } |