Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
92.31% |
12 / 13 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| CapacityReport | |
92.31% |
12 / 13 |
|
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
| readResponse | |
92.31% |
12 / 13 |
|
0.00% |
0 / 1 |
2.00 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * @package zmsstatistic |
| 5 | * @copyright BerlinOnline Stadtportal GmbH & Co. KG |
| 6 | **/ |
| 7 | |
| 8 | namespace BO\Zmsstatistic\Download; |
| 9 | |
| 10 | use BO\Zmsstatistic\Helper\Download; |
| 11 | use Psr\Http\Message\RequestInterface; |
| 12 | use Psr\Http\Message\ResponseInterface; |
| 13 | |
| 14 | class CapacityReport extends Base |
| 15 | { |
| 16 | /** |
| 17 | * @SuppressWarnings(Param) |
| 18 | * @return ResponseInterface |
| 19 | */ |
| 20 | #[\Override] |
| 21 | public function readResponse( |
| 22 | RequestInterface $request, |
| 23 | ResponseInterface $response, |
| 24 | array $args |
| 25 | ) { |
| 26 | $title = !empty($args['downloadTitle']) |
| 27 | ? (string) $args['downloadTitle'] |
| 28 | : 'terminkapazitaet'; |
| 29 | $download = (new Download($request))->setSpreadSheet($title); |
| 30 | $spreadsheet = $download->getSpreadSheet(); |
| 31 | |
| 32 | $this->writeInfoHeader($args, $spreadsheet); |
| 33 | $this->writeFilteredExchangeReport( |
| 34 | $args['report'], |
| 35 | $spreadsheet, |
| 36 | [], |
| 37 | 2 |
| 38 | ); |
| 39 | |
| 40 | return $download->writeDownload($response); |
| 41 | } |
| 42 | } |