@@ -82,12 +82,12 @@ discard block |
||
82 | 82 | public function getPath(string $assetClass, $file, bool $absolute = false): string |
83 | 83 | { |
84 | 84 | if (!isset($this->assets[$assetClass])) { |
85 | - throw new Exception('Asset ' . $assetClass . ' is not registered'); |
|
85 | + throw new Exception('Asset '.$assetClass.' is not registered'); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | return $absolute |
89 | - ? $this->webRoot . $this->getWebDir($this->assets[$assetClass]) . \ltrim($file, '/') |
|
90 | - : $this->getWebDir($this->assets[$assetClass]) . \ltrim($file, '/'); |
|
89 | + ? $this->webRoot.$this->getWebDir($this->assets[$assetClass]).\ltrim($file, '/') |
|
90 | + : $this->getWebDir($this->assets[$assetClass]).\ltrim($file, '/'); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | foreach ($this->assets as $asset) { |
100 | 100 | $links = $this->getLinks($asset, $asset->css()); |
101 | 101 | foreach ($links as $link) { |
102 | - $result[] = '<link rel="stylesheet" href="' . $link . '">'; |
|
102 | + $result[] = '<link rel="stylesheet" href="'.$link.'">'; |
|
103 | 103 | } |
104 | 104 | } |
105 | 105 | return \implode('', $result); |
@@ -112,16 +112,16 @@ discard block |
||
112 | 112 | { |
113 | 113 | $result = []; |
114 | 114 | foreach ($this->assets as $asset) { |
115 | - $productionJs = $this->getWebDir($asset) . self::PRODUCTION_JS; |
|
116 | - $productionJsFile = $this->webRoot . $productionJs; |
|
115 | + $productionJs = $this->getWebDir($asset).self::PRODUCTION_JS; |
|
116 | + $productionJsFile = $this->webRoot.$productionJs; |
|
117 | 117 | if ($this->isProduction() && \file_exists($productionJsFile)) { |
118 | 118 | $links = $this->getLinks($asset, $asset->externalJs()); |
119 | - $links[] = $productionJs . '?' . \filemtime($productionJsFile); |
|
119 | + $links[] = $productionJs.'?'.\filemtime($productionJsFile); |
|
120 | 120 | } else { |
121 | 121 | $links = $this->getLinks($asset, $asset->js()); |
122 | 122 | } |
123 | 123 | foreach ($links as $link) { |
124 | - $result[] = '<script src="' . $link . '"></script>'; |
|
124 | + $result[] = '<script src="'.$link.'"></script>'; |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | return \implode('', $result); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | protected function publishAsset(AbstractAsset $asset) |
152 | 152 | { |
153 | 153 | $hash = $asset->getHash(); |
154 | - $dir = $this->webRoot . '/' . $this->assetDirName . '/' . $hash; |
|
154 | + $dir = $this->webRoot.'/'.$this->assetDirName.'/'.$hash; |
|
155 | 155 | if ($asset->useLinks) { |
156 | 156 | if (!$this->filesystem->exists($dir)) { |
157 | 157 | $this->filesystem->symlink($asset->getBasePath(), $dir, true); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | private function getWebDir(AbstractAsset $asset): string |
174 | 174 | { |
175 | 175 | return $asset->publish |
176 | - ? '/' . $this->assetDirName . '/' . $asset->getHash() . '/' |
|
176 | + ? '/'.$this->assetDirName.'/'.$asset->getHash().'/' |
|
177 | 177 | : '/'; |
178 | 178 | } |
179 | 179 | |
@@ -203,9 +203,9 @@ discard block |
||
203 | 203 | { |
204 | 204 | $link = $file; |
205 | 205 | if (false === \strpos($file, 'http') && false === \strpos($file, '//')) { |
206 | - $filePath = $dir . \ltrim($file, '/'); |
|
207 | - $timestamp = \filemtime($this->webRoot . $filePath); |
|
208 | - $link = $filePath . '?' . $timestamp; |
|
206 | + $filePath = $dir.\ltrim($file, '/'); |
|
207 | + $timestamp = \filemtime($this->webRoot.$filePath); |
|
208 | + $link = $filePath.'?'.$timestamp; |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | return $link; |