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
WorkstationProcessProcessing
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 WorkstationProcessProcessing extends BaseController
11{
12    /**
13     * @SuppressWarnings(Param)
14     * @return String
15     */
16    public function readResponse(
17        \Psr\Http\Message\RequestInterface $request,
18        \Psr\Http\Message\ResponseInterface $response,
19        array $args
20    ) {
21        $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 2])->getEntity();
22        $workstation->process->status = 'processing';
23        if (! $workstation->process->hasId()) {
24            throw new \BO\Zmsentities\Exception\WorkstationMissingAssignedProcess();
25        }
26        $workstation->process = \App::$http->readPostResult(
27            '/process/' . $workstation->process->id . '/' . $workstation->process->authKey . '/',
28            $workstation->process,
29            ['initiator' => 'admin']
30        )->getEntity();
31
32        $validator = $request->getAttribute('validator');
33        $error = $validator->getParameter('error')->isString()->getValue();
34
35        return \BO\Slim\Render::withHtml(
36            $response,
37            'block/process/info.twig',
38            array(
39                'workstation' => $workstation,
40                'error' => $error
41            )
42        );
43    }
44}