| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | public function __invoke(string $file): mixed |
||
| 12 | { |
||
| 13 | /** @var ExportStoredFile $csvFile */ |
||
| 14 | $csvFile = ExportStoredFile::query() |
||
| 15 | ->where('path', $file) |
||
| 16 | ->firstOrFail(); |
||
| 17 | |||
| 18 | $storage = Storage::disk($csvFile->disk); |
||
|
|
|||
| 19 | |||
| 20 | abort_if(!$storage->exists($csvFile->path), 404); |
||
| 21 | |||
| 22 | return $storage->download( |
||
| 23 | $csvFile->path, |
||
| 24 | preg_replace("/[^a-zA-Z0-9\_\-\.\s]/i", '_', $csvFile->name) |
||
| 25 | ); |
||
| 28 |
Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.