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
WorkstationProcessProcessing
100.00% covered (success)
100.00%
20 / 20
100.00% covered (success)
100.00%
1 / 1
2
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
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        $workstation->process->parkedBy = null;
24        if (! $workstation->process->hasId()) {
25            throw new \BO\Zmsentities\Exception\WorkstationMissingAssignedProcess();
26        }
27        $workstation->process = \App::$http->readPostResult(
28            '/process/' . $workstation->process->id . '/' . $workstation->process->authKey . '/',
29            $workstation->process,
30            ['initiator' => 'admin']
31        )->getEntity();
32
33        $validator = $request->getAttribute('validator');
34        $error = $validator->getParameter('error')->isString()->getValue();
35
36        return \BO\Slim\Render::withHtml(
37            $response,
38            'block/process/info.twig',
39            array(
40                'workstation' => $workstation,
41                'error' => $error
42            )
43        );
44    }
45}