Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
76.19% covered (warning)
76.19%
16 / 21
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
WarehousePeriod
76.19% covered (warning)
76.19%
16 / 21
0.00% covered (danger)
0.00%
0 / 1
2.05
0.00% covered (danger)
0.00%
0 / 1
 readResponse
76.19% covered (warning)
76.19%
16 / 21
0.00% covered (danger)
0.00%
0 / 1
2.05
1<?php
2
3/**
4 * @package Zmsadmin
5 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
6 **/
7
8namespace BO\Zmsstatistic;
9
10use BO\Slim\Render;
11use Psr\Http\Message\RequestInterface;
12use Psr\Http\Message\ResponseInterface;
13
14class WarehousePeriod extends BaseController
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        $periodList = \App::http()
27          ->readGetResult('/warehouse/' . $args['subject'] . '/' . $args['subjectid'] . '/')
28          ->getEntity();
29        /** @var mixed $periodList */
30        if (count($periodList['data']) == 1) {
31            return Render::redirect("WarehouseReport", [
32                'subject' => $args['subject'],
33                'subjectid' => $args['subjectid'],
34                'period' => $periodList['data'][0][0],
35            ]);
36        }
37
38        return Render::withHtml(
39            $response,
40            'page/warehousePeriod.twig',
41            array(
42                'title' => 'Kategorien',
43                'menuActive' => 'warehouse',
44                'periodList' => $periodList,
45                'category' => $args['subject'],
46                'subjectId' => $args['subjectid'],
47                'workstation' => $this->workstation->getArrayCopy()
48            )
49        );
50    }
51}