@@ -149,12 +149,12 @@ discard block |
||
| 149 | 149 | $dirPrefix = CRAFT_TEMPLATES_PATH; |
| 150 | 150 | } |
| 151 | 151 | $name = strstr($name, $dirPrefix); |
| 152 | - $name = (string)str_replace($dirPrefix, '', $name); |
|
| 152 | + $name = (string) str_replace($dirPrefix, '', $name); |
|
| 153 | 153 | $path = self::combinePaths( |
| 154 | 154 | $config['localFiles']['basePath'], |
| 155 | 155 | $config['localFiles']['criticalPrefix'], |
| 156 | 156 | $name |
| 157 | - ) . $config['localFiles']['criticalSuffix']; |
|
| 157 | + ).$config['localFiles']['criticalSuffix']; |
|
| 158 | 158 | |
| 159 | 159 | return self::getCssInlineTags($path, $attributes); |
| 160 | 160 | } |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | $dependency = new TagDependency([ |
| 562 | 562 | 'tags' => [ |
| 563 | 563 | self::CACHE_TAG, |
| 564 | - self::CACHE_TAG . $path, |
|
| 564 | + self::CACHE_TAG.$path, |
|
| 565 | 565 | ], |
| 566 | 566 | ]); |
| 567 | 567 | // If this is a file path such as for the `manifest.json`, add a FileDependency so it's cache bust if the file changes |
@@ -588,8 +588,8 @@ discard block |
||
| 588 | 588 | $settings = Twigpack::$plugin->getSettings(); |
| 589 | 589 | $cacheKeySuffix = $settings->cacheKeySuffix ?? ''; |
| 590 | 590 | $file = $cache->getOrSet( |
| 591 | - self::CACHE_KEY . $cacheKeySuffix . $path, |
|
| 592 | - function () use ($path, $callback) { |
|
| 591 | + self::CACHE_KEY.$cacheKeySuffix.$path, |
|
| 592 | + function() use ($path, $callback) { |
|
| 593 | 593 | $result = null; |
| 594 | 594 | $contents = null; |
| 595 | 595 | if (UrlHelper::isAbsoluteUrl($path)) { |
@@ -609,7 +609,7 @@ discard block |
||
| 609 | 609 | if ($response->getStatusCode() === 200) { |
| 610 | 610 | $contents = $response->getBody()->getContents(); |
| 611 | 611 | } |
| 612 | - } catch(GuzzleException $ex) {} |
|
| 612 | + } catch (GuzzleException $ex) {} |
|
| 613 | 613 | } else { |
| 614 | 614 | $contents = @file_get_contents($path); |
| 615 | 615 | } |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | protected static function combinePaths(string ...$paths): string |
| 658 | 658 | { |
| 659 | 659 | $last_key = count($paths) - 1; |
| 660 | - array_walk($paths, function (&$val, $key) use ($last_key) { |
|
| 660 | + array_walk($paths, function(&$val, $key) use ($last_key) { |
|
| 661 | 661 | switch ($key) { |
| 662 | 662 | case 0: |
| 663 | 663 | $val = rtrim($val, '/ '); |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | $cspNonceType = self::getCspNonceType(); |
| 712 | 712 | if ($cspNonceType) { |
| 713 | 713 | $cspValue = "{$cspDirective} 'nonce-$nonce'"; |
| 714 | - foreach(self::CSP_HEADERS as $cspHeader) { |
|
| 714 | + foreach (self::CSP_HEADERS as $cspHeader) { |
|
| 715 | 715 | switch ($cspNonceType) { |
| 716 | 716 | case 'tag': |
| 717 | 717 | Craft::$app->getView()->registerMetaTag([ |
@@ -720,7 +720,7 @@ discard block |
||
| 720 | 720 | ]); |
| 721 | 721 | break; |
| 722 | 722 | case 'header': |
| 723 | - Craft::$app->getResponse()->getHeaders()->add($cspHeader, $cspValue . ';'); |
|
| 723 | + Craft::$app->getResponse()->getHeaders()->add($cspHeader, $cspValue.';'); |
|
| 724 | 724 | break; |
| 725 | 725 | default: |
| 726 | 726 | break; |
@@ -766,7 +766,7 @@ discard block |
||
| 766 | 766 | { |
| 767 | 767 | $json = JsonHelper::decodeIfJson($string); |
| 768 | 768 | if (is_string($json)) { |
| 769 | - Craft::error('Error decoding JSON file: ' . $json, __METHOD__); |
|
| 769 | + Craft::error('Error decoding JSON file: '.$json, __METHOD__); |
|
| 770 | 770 | $json = null; |
| 771 | 771 | } |
| 772 | 772 | |