@@ -104,14 +104,14 @@ |
||
| 104 | 104 | /** |
| 105 | 105 | * Inline the contents of a local file (via path) or remote file (via URL) in your templates. |
| 106 | 106 | * Yii2 aliases and/or environment variables may be used. |
| 107 | - * If $manifest is true, the local file path will be returned from the manifest |
|
| 107 | + * If $manifest is true, the local file path will be returned from the manifest |
|
| 108 | 108 | * |
| 109 | 109 | * @param string $pathOrUrl |
| 110 | 110 | * @param boolean $manifest |
| 111 | 111 | * |
| 112 | 112 | * @return Markup |
| 113 | 113 | */ |
| 114 | - public function inline(string $pathOrUrl, bool $manifest=false): Markup |
|
| 114 | + public function inline(string $pathOrUrl, bool $manifest=false): Markup |
|
| 115 | 115 | { |
| 116 | 116 | if ($manifest) { |
| 117 | 117 | $manifestPath = $this->viteService->manifestAsset($pathOrUrl, true); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * |
| 95 | 95 | * @return Markup |
| 96 | 96 | */ |
| 97 | - public function asset(string $path, bool $public=false): Markup |
|
| 97 | + public function asset(string $path, bool $public = false): Markup |
|
| 98 | 98 | { |
| 99 | 99 | return Template::raw( |
| 100 | 100 | $this->viteService->asset($path, $public) |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * |
| 112 | 112 | * @return Markup |
| 113 | 113 | */ |
| 114 | - public function inline(string $pathOrUrl, bool $manifest=false): Markup |
|
| 114 | + public function inline(string $pathOrUrl, bool $manifest = false): Markup |
|
| 115 | 115 | { |
| 116 | 116 | if ($manifest) { |
| 117 | 117 | $manifestPath = $this->viteService->manifestAsset($pathOrUrl, true); |
@@ -50,12 +50,12 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public static function fetch(string $pathOrUrl, callable $callback = null, string $cacheKeySuffix = '') |
| 52 | 52 | { |
| 53 | - $pathOrUrl = (string)Craft::parseEnv($pathOrUrl); |
|
| 53 | + $pathOrUrl = (string) Craft::parseEnv($pathOrUrl); |
|
| 54 | 54 | // Create the dependency tags |
| 55 | 55 | $dependency = new TagDependency([ |
| 56 | 56 | 'tags' => [ |
| 57 | - self::CACHE_TAG . $cacheKeySuffix, |
|
| 58 | - self::CACHE_TAG . $cacheKeySuffix . $pathOrUrl, |
|
| 57 | + self::CACHE_TAG.$cacheKeySuffix, |
|
| 58 | + self::CACHE_TAG.$cacheKeySuffix.$pathOrUrl, |
|
| 59 | 59 | ], |
| 60 | 60 | ]); |
| 61 | 61 | // If this is a file path such as for the `manifest.json`, add a FileDependency so it's cache bust if the file changes |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | // Get the result from the cache, or parse the file |
| 77 | 77 | $cache = Craft::$app->getCache(); |
| 78 | 78 | return $cache->getOrSet( |
| 79 | - self::CACHE_KEY . $cacheKeySuffix . $pathOrUrl, |
|
| 80 | - function () use ($pathOrUrl, $callback) { |
|
| 79 | + self::CACHE_KEY.$cacheKeySuffix.$pathOrUrl, |
|
| 80 | + function() use ($pathOrUrl, $callback) { |
|
| 81 | 81 | $contents = null; |
| 82 | 82 | if (UrlHelper::isAbsoluteUrl($pathOrUrl)) { |
| 83 | 83 | $response = self::fetchResponse($pathOrUrl); |
@@ -137,8 +137,8 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | public static function createUrl(string $url, string $path): string |
| 139 | 139 | { |
| 140 | - $url = (string)Craft::parseEnv($url); |
|
| 141 | - return rtrim($url, '/') . '/' . trim($path, '/'); |
|
| 140 | + $url = (string) Craft::parseEnv($url); |
|
| 141 | + return rtrim($url, '/').'/'.trim($path, '/'); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /** |
@@ -150,8 +150,8 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | public static function createPath(string $distPath, string $path): string |
| 152 | 152 | { |
| 153 | - $distPath = (string)Craft::parseEnv($distPath); |
|
| 154 | - return rtrim($distPath, '/') . '/' . trim($path, '/'); |
|
| 153 | + $distPath = (string) Craft::parseEnv($distPath); |
|
| 154 | + return rtrim($distPath, '/').'/'.trim($path, '/'); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /** |