Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
16 / 16
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
WorkstationProcess
100.00% covered (success)
100.00%
16 / 16
100.00% covered (success)
100.00%
1 / 1
5
100.00% covered (success)
100.00%
1 / 1
 readResponse
100.00% covered (success)
100.00%
16 / 16
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
10/**
11  * Init Controller to display next Button Template only
12  *
13  */
14class WorkstationProcess extends BaseController
15{
16    /**
17     * @SuppressWarnings(Param)
18     * @return String
19     */
20    public function readResponse(
21        \Psr\Http\Message\RequestInterface $request,
22        \Psr\Http\Message\ResponseInterface $response,
23        array $args
24    ) {
25        $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 2])->getEntity();
26        $template = ($workstation->process->hasId() && 'processing' == $workstation->process->status) ? 'info' : 'next';
27        if ($workstation->process->hasId() && 'called' == $workstation->process->getStatus()) {
28            return \BO\Slim\Render::redirect(
29                'workstationProcessCalled',
30                array(
31                    'id' => $workstation->process->id
32                )
33            );
34        }
35        return \BO\Slim\Render::withHtml(
36            $response,
37            'block/process/' . $template . '.twig',
38            array(
39                'workstation' => $workstation
40            )
41        );
42    }
43}