Passed
Branch v4 (4ff8df)
by Andrew
27:49 queued 21:06
created
src/helpers/ManifestHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,14 +45,14 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/services/VitePluginService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
     public function init(): void
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
         }
Please login to merge, or discard this patch.
src/services/ViteService.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      * @var array|string The JavaScript entry from the manifest.json to inject on Twig error pages
63 63
      *              This can be a string or an array of strings
64 64
      */
65
-    public array|string $errorEntry = '';
65
+    public array | string $errorEntry = '';
66 66
 
67 67
     /**
68 68
      * @var string String to be appended to the cache key
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
      *
194 194
      * @return string|array|null
195 195
      */
196
-    public function fetch(string $pathOrUrl, callable $callback = null): string|array|null
196
+    public function fetch(string $pathOrUrl, callable $callback = null): string | array | null
197 197
     {
198 198
         // If the devServer is running, and this is a URL, swap in the devServerInternal URL
199 199
         if ($this->devServerRunning()) {
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
                 // Replace the hard-coded dev server URL with whatever they have theirs set to
231 231
                 $script = str_replace(
232 232
                     'http://localhost:3000/',
233
-                    rtrim($this->devServerPublic, '/') . '/',
233
+                    rtrim($this->devServerPublic, '/').'/',
234 234
                     $script
235 235
                 );
236 236
                 $view->registerScript(
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
         $view->registerJsFile(
250 250
             $url,
251 251
             array_merge(['type' => 'module'], $scriptTagAttrs),
252
-            md5($url . JsonHelper::encode($scriptTagAttrs))
252
+            md5($url.JsonHelper::encode($scriptTagAttrs))
253 253
         );
254 254
     }
255 255
 
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
     public function invalidateCaches(): void
392 392
     {
393 393
         $cache = Craft::$app->getCache();
394
-        TagDependency::invalidate($cache, FileHelper::CACHE_TAG . $this->cacheKeySuffix);
394
+        TagDependency::invalidate($cache, FileHelper::CACHE_TAG.$this->cacheKeySuffix);
395 395
         Craft::info('All Vite caches cleared', __METHOD__);
396 396
     }
397 397
 
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
                 // Replace the hard-coded dev server URL with whatever they have theirs set to
435 435
                 $script = str_replace(
436 436
                     'http://localhost:3000/',
437
-                    rtrim($this->devServerPublic, '/') . '/',
437
+                    rtrim($this->devServerPublic, '/').'/',
438 438
                     $script
439 439
                 );
440 440
                 $lines[] = HtmlHelper::script(
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
                         $view->registerJsFile(
518 518
                             $url,
519 519
                             $tag['options'],
520
-                            md5($url . JsonHelper::encode($tag['options']))
520
+                            md5($url.JsonHelper::encode($tag['options']))
521 521
                         );
522 522
                         break;
523 523
                     case 'css':
Please login to merge, or discard this patch.
ecs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
src/helpers/FileHelper.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.