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