Completed
Push — master ( 408bbf...c4988a )
by Maxim
02:29
created
src/assets/AssetManager.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
     public function getPath(string $assetClass, $file): string
61 61
     {
62 62
         if (!isset($this->assets[$assetClass])) {
63
-            throw new Exception('Asset ' . $assetClass . ' is not registered');
63
+            throw new Exception('Asset '.$assetClass.' is not registered');
64 64
         }
65 65
 
66
-        return $this->getWebDir($this->assets[$assetClass]) . \ltrim($file, '/');
66
+        return $this->getWebDir($this->assets[$assetClass]).\ltrim($file, '/');
67 67
     }
68 68
 
69 69
     /**
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         foreach ($this->assets as $asset) {
76 76
             $links = $this->getLinks($asset, $asset->css());
77 77
             foreach ($links as $link) {
78
-                $result[] = '<link rel="stylesheet" href="' . $link . '">';
78
+                $result[] = '<link rel="stylesheet" href="'.$link.'">';
79 79
             }
80 80
         }
81 81
         return \implode('', $result);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         foreach ($this->assets as $asset) {
91 91
             $links = $this->getLinks($asset, $asset->js());
92 92
             foreach ($links as $link) {
93
-                $result[] = '<script src="' . $link . '"></script>';
93
+                $result[] = '<script src="'.$link.'"></script>';
94 94
             }
95 95
         }
96 96
         return \implode('', $result);
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     protected function publishAsset(AbstractAsset $asset)
105 105
     {
106 106
         $hash = $asset->getHash();
107
-        $dir = $this->webRoot . '/' . $this->assetDirName . '/' . $hash;
107
+        $dir = $this->webRoot.'/'.$this->assetDirName.'/'.$hash;
108 108
         if ($asset->useLinks) {
109 109
             if (!$this->filesystem->exists($dir)) {
110 110
                 $this->filesystem->symlink($asset->getBasePath(), $dir, true);
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
     private function getWebDir(AbstractAsset $asset): string
127 127
     {
128 128
         return $asset->publish
129
-            ? '/' . $this->assetDirName . '/' . $asset->getHash() . '/'
129
+            ? '/'.$this->assetDirName.'/'.$asset->getHash().'/'
130 130
             : '/';
131 131
     }
132 132
 
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
     {
157 157
         $link = $file;
158 158
         if (false === \strpos($file, 'http') && false === \strpos($file, '//')) {
159
-            $filePath = $dir . \ltrim($file, '/');
160
-            $timestamp = \filemtime($this->webRoot . $filePath);
161
-            $link = $filePath . '?' . $timestamp;
159
+            $filePath = $dir.\ltrim($file, '/');
160
+            $timestamp = \filemtime($this->webRoot.$filePath);
161
+            $link = $filePath.'?'.$timestamp;
162 162
         }
163 163
 
164 164
         return $link;
Please login to merge, or discard this patch.