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    ) {
26        $periodList = \App::$http
27          ->readGetResult('/warehouse/' . $args['subject'] . '/' . $args['subjectid'] . '/')
28          ->getEntity();
29        if (count($periodList['data']) == 1) {
30            return Render::redirect("WarehouseReport", [
31                'subject' => $args['subject'],
32                'subjectid' => $args['subjectid'],
33                'period' => $periodList['data'][0][0],
34            ]);
35        }
36
37        return Render::withHtml(
38            $response,
39            'page/warehousePeriod.twig',
40            array(
41                'title' => 'Kategorien',
42                'menuActive' => 'warehouse',
43                'periodList' => $periodList,
44                'category' => $args['subject'],
45                'subjectId' => $args['subjectid'],
46                'workstation' => $this->workstation->getArrayCopy()
47            )
48        );
49    }
50}