Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
19 / 19
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
CounterQueueInfo
100.00% covered (success)
100.00%
19 / 19
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
1 / 1
 readResponse
100.00% covered (success)
100.00%
19 / 19
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2
3/**
4 * @package Zmsadmin
5 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
6 **/
7
8namespace BO\Zmsadmin;
9
10class CounterQueueInfo extends BaseController
11{
12    /**
13     * @SuppressWarnings(Param)
14     * @return \Psr\Http\Message\ResponseInterface
15     */
16    #[\Override]
17    public function readResponse(
18        \Psr\Http\Message\RequestInterface $request,
19        \Psr\Http\Message\ResponseInterface $response,
20        array $args
21    ): \Psr\Http\Message\ResponseInterface {
22        $validator = $request->getAttribute('validator');
23        $selectedDate = $validator->getParameter('selecteddate')->isString()->getValue();
24        $ghostWorkstation = $validator->getParameter('ghostworkstationcount')->isNumber()->getValue();
25        $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 2])->getEntity();
26
27        if ($ghostWorkstation >= -1) {
28            $scope = $workstation->getScope();
29            $scope->setStatusQueue('ghostWorkstationCount', $ghostWorkstation);
30            $workstation->scope = \App::$http
31                ->readPostResult("/scope/$scope->id/ghostworkstation/", $scope)->getEntity();
32        }
33        $workstationInfo = Helper\WorkstationInfo::getInfoBoxData($workstation, $selectedDate);
34
35        return \BO\Slim\Render::withHtml(
36            $response,
37            'block/queue/info.twig',
38            array(
39                'workstation' => $workstation,
40                'workstationInfo' => $workstationInfo,
41                'selectedDate' => $selectedDate
42            )
43        );
44    }
45}