| Total Complexity | 2 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | class Excel implements ExporterInterface |
||
| 21 | { |
||
| 22 | public const XLSX = 'Xlsx'; |
||
| 23 | |||
| 24 | public const CSV = 'Csv'; |
||
| 25 | |||
| 26 | public function download( |
||
| 27 | $exportClass, |
||
| 28 | string $fileName, |
||
| 29 | string $writerType = null, |
||
| 30 | array $headers = [] |
||
| 31 | ): Response { |
||
| 32 | |||
| 33 | $output = (new Writer())->export($exportClass, $writerType); |
||
|
|
|||
| 34 | |||
| 35 | $fileName = $fileName.'.'.$this->makeFileNameExtension($writerType); |
||
| 36 | |||
| 37 | return (new ResponseFactory())->makeResponse($writerType, $output, $fileName); |
||
| 38 | } |
||
| 39 | |||
| 40 | public function makeFileNameExtension($writerType): string |
||
| 43 | } |
||
| 44 | } |
||
| 45 |