Passed
Pull Request — v1 (#2)
by John D
08:05
created
src/services/ViteService.php 1 patch
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -233,30 +233,30 @@  discard block
 block discarded – undo
233 233
         }
234 234
 
235 235
         // modulepreload any imports from modern tags
236
-	    $modulepreloadPolyfillRequired = false;
237
-	    foreach($tags as $tag) {
238
-		    if (!empty($tag)) {
239
-			    $url = FileHelper::createUrl($this->serverPublic, $tag['url']);
240
-			    switch ($tag['type']) {
241
-				    case 'import':
242
-					    $lines[] = HtmlHelper::tag('link', '', [
243
-						    'crossorigin' => $tag['crossorigin'],
244
-						    'href' => $url,
245
-						    'rel' => 'modulepreload',
246
-					    ]);
247
-					    $modulepreloadPolyfillRequired = true;
248
-					    break;
249
-				    default:
250
-					    break;
251
-			    }
252
-		    }
253
-	    }
254
-	    if($modulepreloadPolyfillRequired && ! $this->modulepreloadPolyfillIncluded) {
255
-	        $this->modulepreloadPolyfillIncluded = true;
256
-	        $lines[] = HtmlHelper::script(
257
-		        FileHelper::fetchScript('modulepreload-polyfill.min.js', $this->cacheKeySuffix),
258
-		        ['type' => 'module']
259
-	        );
236
+        $modulepreloadPolyfillRequired = false;
237
+        foreach($tags as $tag) {
238
+            if (!empty($tag)) {
239
+                $url = FileHelper::createUrl($this->serverPublic, $tag['url']);
240
+                switch ($tag['type']) {
241
+                    case 'import':
242
+                        $lines[] = HtmlHelper::tag('link', '', [
243
+                            'crossorigin' => $tag['crossorigin'],
244
+                            'href' => $url,
245
+                            'rel' => 'modulepreload',
246
+                        ]);
247
+                        $modulepreloadPolyfillRequired = true;
248
+                        break;
249
+                    default:
250
+                        break;
251
+                }
252
+            }
253
+        }
254
+        if($modulepreloadPolyfillRequired && ! $this->modulepreloadPolyfillIncluded) {
255
+            $this->modulepreloadPolyfillIncluded = true;
256
+            $lines[] = HtmlHelper::script(
257
+                FileHelper::fetchScript('modulepreload-polyfill.min.js', $this->cacheKeySuffix),
258
+                ['type' => 'module']
259
+            );
260 260
         }
261 261
 
262 262
         return implode("\r\n", $lines);
@@ -383,37 +383,37 @@  discard block
 block discarded – undo
383 383
             }
384 384
         }
385 385
 
386
-	    // modulepreload any imports from modern tags
387
-	    $modulepreloadPolyfillRequired = false;
388
-	    foreach($tags as $tag) {
389
-		    if (!empty($tag)) {
390
-			    $url = FileHelper::createUrl($this->serverPublic, $tag['url']);
391
-			    switch ($tag['type']) {
392
-				    case 'import':
393
-					    $view->registerLinkTag(
394
-						    [
395
-							    'crossorigin' => $tag['crossorigin'],
396
-							    'href' => $url,
397
-							    'rel' => 'modulepreload',
398
-						    ],
399
-						    md5($url)
400
-					    );
401
-					    $modulepreloadPolyfillRequired = true;
402
-					    break;
403
-				    default:
404
-					    break;
405
-			    }
406
-		    }
407
-	    }
408
-	    if($modulepreloadPolyfillRequired && ! $this->modulepreloadPolyfillIncluded) {
409
-		    $this->modulepreloadPolyfillIncluded = true;
410
-		    $view->registerScript(
411
-			    FileHelper::fetchScript('modulepreload-polyfill.min.js', $this->cacheKeySuffix),
412
-			    $view::POS_HEAD,
413
-			    ['type' => 'module'],
414
-			    'MODULEPRELOAD_POLYFILL'
415
-		    );
416
-	    }
386
+        // modulepreload any imports from modern tags
387
+        $modulepreloadPolyfillRequired = false;
388
+        foreach($tags as $tag) {
389
+            if (!empty($tag)) {
390
+                $url = FileHelper::createUrl($this->serverPublic, $tag['url']);
391
+                switch ($tag['type']) {
392
+                    case 'import':
393
+                        $view->registerLinkTag(
394
+                            [
395
+                                'crossorigin' => $tag['crossorigin'],
396
+                                'href' => $url,
397
+                                'rel' => 'modulepreload',
398
+                            ],
399
+                            md5($url)
400
+                        );
401
+                        $modulepreloadPolyfillRequired = true;
402
+                        break;
403
+                    default:
404
+                        break;
405
+                }
406
+            }
407
+        }
408
+        if($modulepreloadPolyfillRequired && ! $this->modulepreloadPolyfillIncluded) {
409
+            $this->modulepreloadPolyfillIncluded = true;
410
+            $view->registerScript(
411
+                FileHelper::fetchScript('modulepreload-polyfill.min.js', $this->cacheKeySuffix),
412
+                $view::POS_HEAD,
413
+                ['type' => 'module'],
414
+                'MODULEPRELOAD_POLYFILL'
415
+            );
416
+        }
417 417
     }
418 418
 
419 419
     /**
Please login to merge, or discard this patch.