Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
20 / 20
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
WorkstationProcess
100.00% covered (success)
100.00%
20 / 20
100.00% covered (success)
100.00%
1 / 1
5
100.00% covered (success)
100.00%
1 / 1
 readResponse
100.00% covered (success)
100.00%
20 / 20
100.00% covered (success)
100.00%
1 / 1
5
1<?php
2
3/**
4 * @package Zmsadmin
5 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
6 **/
7
8namespace BO\Zmsadmin;
9
10use DateTime;
11
12/**
13  * Init Controller to display next Button Template only
14  *
15  */
16class WorkstationProcess extends BaseController
17{
18    /**
19     * @SuppressWarnings(Param)
20     * @return \Psr\Http\Message\ResponseInterface
21     */
22    #[\Override]
23    public function readResponse(
24        \Psr\Http\Message\RequestInterface $request,
25        \Psr\Http\Message\ResponseInterface $response,
26        array $args
27    ): \Psr\Http\Message\ResponseInterface {
28        $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 2])->getEntity();
29        $template = ($workstation->process->hasId() && 'processing' == $workstation->process->status) ? 'info' : 'next';
30        $selectedDate = (new DateTime())->format('Y-m-d');
31        if ($workstation->process->hasId() && 'called' == $workstation->process->getStatus()) {
32            return \BO\Slim\Render::redirect(
33                'workstationProcessCalled',
34                array(
35                    'id' => $workstation->process->id
36                )
37            );
38        }
39        $workstationInfo = Helper\WorkstationInfo::getInfoBoxData($workstation, $selectedDate);
40        return \BO\Slim\Render::withHtml(
41            $response,
42            'block/process/' . $template . '.twig',
43            array(
44                'workstation' => $workstation,
45                'workstationInfo' => $workstationInfo,
46                'selectedDate' => $selectedDate
47            )
48        );
49    }
50}