| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function getFile(string $path): self |
||
| 29 | { |
||
| 30 | $filePath = Util::joinFile($this->config->getStaticPath(), $path); |
||
| 31 | |||
| 32 | if (!Util::getFS()->exists($filePath)) { |
||
| 33 | throw new Exception(sprintf('Asset file "%s" doesn\'t exist.', $path)); |
||
| 34 | } |
||
| 35 | $this->fileLoaded = true; |
||
| 36 | |||
| 37 | $fileInfo = new \SplFileInfo($filePath); |
||
| 38 | |||
| 39 | $this->asset['path'] = $path; |
||
| 40 | $this->asset['ext'] = $fileInfo->getExtension(); |
||
| 41 | |||
| 42 | return $this; |
||
| 43 | } |
||
| 69 |
The
breakstatement is not necessary if it is preceded for example by areturnstatement:If you would like to keep this construct to be consistent with other
casestatements, you can safely mark this issue as a false-positive.