@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $tags = array_merge($legacyPolyfillTags, $tags); |
| 159 | 159 | $this->legacyPolyfillIncluded = true; |
| 160 | 160 | } |
| 161 | - foreach($tags as $tag) { |
|
| 161 | + foreach ($tags as $tag) { |
|
| 162 | 162 | if (!empty($tag)) { |
| 163 | 163 | switch ($tag['type']) { |
| 164 | 164 | case 'file': |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | $tags = array_merge($legacyPolyfillTags, $tags); |
| 241 | 241 | $this->legacyPolyfillIncluded = true; |
| 242 | 242 | } |
| 243 | - foreach($tags as $tag) { |
|
| 243 | + foreach ($tags as $tag) { |
|
| 244 | 244 | if (!empty($tag)) { |
| 245 | 245 | switch ($tag['type']) { |
| 246 | 246 | case 'file': |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | '', |
| 249 | 249 | $view::POS_HEAD, |
| 250 | 250 | array_merge(['src' => $tag['url']], $tag['options']), |
| 251 | - md5($tag['url'] . json_encode($tag['options'])) |
|
| 251 | + md5($tag['url'].json_encode($tag['options'])) |
|
| 252 | 252 | ); |
| 253 | 253 | break; |
| 254 | 254 | case 'css': |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | public function invalidateCaches() |
| 283 | 283 | { |
| 284 | 284 | $cache = Craft::$app->getCache(); |
| 285 | - TagDependency::invalidate($cache, self::CACHE_TAG . $this->cacheKeySuffix); |
|
| 285 | + TagDependency::invalidate($cache, self::CACHE_TAG.$this->cacheKeySuffix); |
|
| 286 | 286 | Craft::info('All Vite caches cleared', __METHOD__); |
| 287 | 287 | } |
| 288 | 288 | |
@@ -338,11 +338,11 @@ discard block |
||
| 338 | 338 | { |
| 339 | 339 | $tags = []; |
| 340 | 340 | // Grab the manifest |
| 341 | - $pathOrUrl = (string)Craft::parseEnv($this->manifestPath); |
|
| 341 | + $pathOrUrl = (string) Craft::parseEnv($this->manifestPath); |
|
| 342 | 342 | $manifest = $this->fetchFile($pathOrUrl, [JsonHelper::class, 'decodeIfJson']); |
| 343 | 343 | // If no manifest file is found, bail |
| 344 | 344 | if ($manifest === null) { |
| 345 | - Craft::error('Manifest not found at ' . $this->manifestPath, __METHOD__); |
|
| 345 | + Craft::error('Manifest not found at '.$this->manifestPath, __METHOD__); |
|
| 346 | 346 | |
| 347 | 347 | return []; |
| 348 | 348 | } |
@@ -435,8 +435,8 @@ discard block |
||
| 435 | 435 | */ |
| 436 | 436 | protected function createUrl(string $url, string $path): string |
| 437 | 437 | { |
| 438 | - $url = (string)Craft::parseEnv($url); |
|
| 439 | - return rtrim($url, '/') . '/' . trim($path, '/'); |
|
| 438 | + $url = (string) Craft::parseEnv($url); |
|
| 439 | + return rtrim($url, '/').'/'.trim($path, '/'); |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | /** |
@@ -451,8 +451,8 @@ discard block |
||
| 451 | 451 | // Create the dependency tags |
| 452 | 452 | $dependency = new TagDependency([ |
| 453 | 453 | 'tags' => [ |
| 454 | - self::CACHE_TAG . $this->cacheKeySuffix, |
|
| 455 | - self::CACHE_TAG . $this->cacheKeySuffix . $pathOrUrl, |
|
| 454 | + self::CACHE_TAG.$this->cacheKeySuffix, |
|
| 455 | + self::CACHE_TAG.$this->cacheKeySuffix.$pathOrUrl, |
|
| 456 | 456 | ], |
| 457 | 457 | ]); |
| 458 | 458 | // If this is a file path such as for the `manifest.json`, add a FileDependency so it's cache bust if the file changes |
@@ -473,8 +473,8 @@ discard block |
||
| 473 | 473 | // Get the result from the cache, or parse the file |
| 474 | 474 | $cache = Craft::$app->getCache(); |
| 475 | 475 | $file = $cache->getOrSet( |
| 476 | - self::CACHE_KEY . $this->cacheKeySuffix . $pathOrUrl, |
|
| 477 | - function () use ($pathOrUrl, $callback) { |
|
| 476 | + self::CACHE_KEY.$this->cacheKeySuffix.$pathOrUrl, |
|
| 477 | + function() use ($pathOrUrl, $callback) { |
|
| 478 | 478 | $contents = null; |
| 479 | 479 | $result = null; |
| 480 | 480 | if (UrlHelper::isAbsoluteUrl($pathOrUrl)) { |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | $bundle->sourcePath, |
| 60 | 60 | true |
| 61 | 61 | ); |
| 62 | - $this->manifestPath = Craft::getAlias($bundle->sourcePath) . '/manifest.json'; |
|
| 62 | + $this->manifestPath = Craft::getAlias($bundle->sourcePath).'/manifest.json'; |
|
| 63 | 63 | $this->serverPublic = $baseAssetsUrl; |
| 64 | 64 | } |
| 65 | 65 | } |