Lines 0.00% 0 / 12
Functions and Methods 0.00% 0 / 1
Classes and Traits 0.00% 0 / 1
Name Lines Functions and Methods CRAP Classes and Traits
WorkstationProcessParked 0.00% 0 / 12 0.00% 0 / 1 12 0.00% 0 / 1
 readResponse 0.00% 0 / 12 0.00% 0 / 1 12
1<?php
2
3/**
4 * @package Zmsadmin
5 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
6 **/
7
8namespace BO\Zmsadmin;
9
10use BO\Slim\Render;
11
12class WorkstationProcessParked extends BaseController
13{
14    /**
15     * @SuppressWarnings(Param)
16     * @return \Psr\Http\Message\ResponseInterface
17     */
18    #[\Override]
19    public function readResponse(
20        \Psr\Http\Message\RequestInterface $request,
21        \Psr\Http\Message\ResponseInterface $response,
22        array $args
23    ): \Psr\Http\Message\ResponseInterface {
24        $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 2])->getEntity();
25        $validator = $request->getAttribute('validator');
26        $noRedirect = $validator->getParameter('noredirect')->isNumber()->getValue();
27        if ($workstation->process['id']) {
28            \App::$http->readDeleteResult('/workstation/process/parked/')->getEntity();
29        }
30        if (1 == $noRedirect) {
31            return $response;
32        }
33        return Render::redirect(
34            'workstationProcessCallButton',
35            array(),
36            array()
37        );
38    }
39}