@@ -45,14 +45,14 @@ |
||
45 | 45 | public static function fetchManifest(string $manifestPath) |
46 | 46 | { |
47 | 47 | // Grab the manifest |
48 | - $pathOrUrl = (string)Craft::parseEnv($manifestPath); |
|
48 | + $pathOrUrl = (string) Craft::parseEnv($manifestPath); |
|
49 | 49 | $manifest = FileHelper::fetch($pathOrUrl, [JsonHelper::class, 'decodeIfJson']); |
50 | 50 | // If no manifest file is found, log it |
51 | 51 | if ($manifest === null) { |
52 | - Craft::error('Manifest not found at ' . $manifestPath, __METHOD__); |
|
52 | + Craft::error('Manifest not found at '.$manifestPath, __METHOD__); |
|
53 | 53 | } |
54 | 54 | // Ensure we're dealing with an array |
55 | - self::$manifest = (array)$manifest; |
|
55 | + self::$manifest = (array) $manifest; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | // Replace the hard-coded dev server URL with whatever they have theirs set to |
212 | 212 | $script = str_replace( |
213 | 213 | 'http://localhost:3000/', |
214 | - rtrim($this->devServerPublic, '/') . '/', |
|
214 | + rtrim($this->devServerPublic, '/').'/', |
|
215 | 215 | $script |
216 | 216 | ); |
217 | 217 | $view->registerScript( |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $view->registerJsFile( |
231 | 231 | $url, |
232 | 232 | array_merge(['type' => 'module'], $scriptTagAttrs), |
233 | - md5($url . JsonHelper::encode($scriptTagAttrs)) |
|
233 | + md5($url.JsonHelper::encode($scriptTagAttrs)) |
|
234 | 234 | ); |
235 | 235 | } |
236 | 236 | |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | public function invalidateCaches() |
352 | 352 | { |
353 | 353 | $cache = Craft::$app->getCache(); |
354 | - TagDependency::invalidate($cache, FileHelper::CACHE_TAG . $this->cacheKeySuffix); |
|
354 | + TagDependency::invalidate($cache, FileHelper::CACHE_TAG.$this->cacheKeySuffix); |
|
355 | 355 | Craft::info('All Vite caches cleared', __METHOD__); |
356 | 356 | } |
357 | 357 | |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | // Replace the hard-coded dev server URL with whatever they have theirs set to |
395 | 395 | $script = str_replace( |
396 | 396 | 'http://localhost:3000/', |
397 | - rtrim($this->devServerPublic, '/') . '/', |
|
397 | + rtrim($this->devServerPublic, '/').'/', |
|
398 | 398 | $script |
399 | 399 | ); |
400 | 400 | $lines[] = HtmlHelper::script( |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | $view->registerJsFile( |
478 | 478 | $url, |
479 | 479 | $tag['options'], |
480 | - md5($url . JsonHelper::encode($tag['options'])) |
|
480 | + md5($url.JsonHelper::encode($tag['options'])) |
|
481 | 481 | ); |
482 | 482 | break; |
483 | 483 | case 'css': |
@@ -46,7 +46,7 @@ |
||
46 | 46 | public function init() |
47 | 47 | { |
48 | 48 | // See if the $pluginDevServerEnvVar env var exists, and if not, don't run off of the dev server |
49 | - $useDevServer = (bool)App::env($this->pluginDevServerEnvVar); |
|
49 | + $useDevServer = (bool) App::env($this->pluginDevServerEnvVar); |
|
50 | 50 | if ($useDevServer === false) { |
51 | 51 | $this->useDevServer = false; |
52 | 52 | } |
@@ -5,7 +5,7 @@ |
||
5 | 5 | |
6 | 6 | return static function(ECSConfig $ecsConfig): void { |
7 | 7 | $ecsConfig->paths([ |
8 | - __DIR__ . '/src', |
|
8 | + __DIR__.'/src', |
|
9 | 9 | __FILE__, |
10 | 10 | ]); |
11 | 11 | $ecsConfig->parallel(); |
@@ -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,7 +76,7 @@ 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, |
|
79 | + self::CACHE_KEY.$cacheKeySuffix.$pathOrUrl, |
|
80 | 80 | function() use ($pathOrUrl, $callback) { |
81 | 81 | $contents = null; |
82 | 82 | if (UrlHelper::isAbsoluteUrl($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 | /** |