Lines 92.30% 12 / 13
Functions and Methods 0.00% 0 / 1
Classes and Traits 0.00% 0 / 1
Name Lines Functions and Methods CRAP Classes and Traits
CapacityReport 92.30% 12 / 13 0.00% 0 / 1 2.00 0.00% 0 / 1
 readResponse 92.30% 12 / 13 0.00% 0 / 1 2.00
1<?php
2
3/**
4 * @package zmsstatistic
5 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
6 **/
7
8namespace BO\Zmsstatistic\Download;
9
10use BO\Zmsstatistic\Helper\Download;
11use Psr\Http\Message\RequestInterface;
12use Psr\Http\Message\ResponseInterface;
13
14class 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    ): mixed {
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}