| Conditions | 5 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5.1502 |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | 2 | public function execute(): void |
|
| 37 | { |
||
| 38 | 2 | foreach ($this->staticFiles as $staticFile) { |
|
| 39 | 2 | $staticFile = trim($staticFile, '/'); |
|
| 40 | |||
| 41 | 2 | $publicPath = File::path("{$this->publicDirectory}/{$staticFile}"); |
|
| 42 | |||
| 43 | 2 | if ($this->cacheStaticFiles && $this->fs->exists($publicPath)) { |
|
| 44 | continue; |
||
| 45 | } |
||
| 46 | |||
| 47 | 2 | $sourcePath = File::path($staticFile); |
|
| 48 | |||
| 49 | try { |
||
| 50 | 2 | $this->copyStaticFile($sourcePath, $publicPath); |
|
| 51 | } catch (FileNotFoundException $exception) { |
||
| 52 | 2 | throw FileNotFound::staticFile($sourcePath); |
|
| 53 | } |
||
| 54 | } |
||
| 55 | 2 | } |
|
| 56 | |||
| 70 |