| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | 3 | public function download(Activity $activity, ModuleInstance $moduleInstance, File $file) |
|
| 16 | { |
||
| 17 | 3 | $this->authorize('admin.file.download'); |
|
| 18 | |||
| 19 | 2 | if(Storage::exists($file->path)) { |
|
| 20 | 1 | return Storage::download($file->path, $file->filename, [ |
|
| 21 | 1 | 'X-Vapor-Base64-Encode' => 'True' |
|
| 22 | ]); |
||
| 23 | } |
||
| 24 | |||
| 25 | 1 | throw new HttpException(404, 'File not found'); |
|
| 26 | } |
||
| 28 | } |