Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function load(string $path): self |
||
28 | { |
||
29 | $filePath = Util::joinFile($this->config->getStaticPath(), $path); |
||
30 | |||
31 | if (!Util::getFS()->exists($filePath)) { |
||
32 | throw new Exception(sprintf('Asset file "%s" doesn\'t exist.', $path)); |
||
33 | } |
||
34 | |||
35 | $fileInfo = new \SplFileInfo($filePath); |
||
36 | |||
37 | $this->asset['path'] = $path; |
||
38 | $this->asset['ext'] = $fileInfo->getExtension(); |
||
39 | |||
40 | return $this; |
||
41 | } |
||
53 |