Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
14 / 14
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
WorkstationProcessCancelNext
100.00% covered (success)
100.00%
14 / 14
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
1 / 1
 readResponse
100.00% covered (success)
100.00%
14 / 14
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\Zmsadmin\Helper\ExcludeIds;
11
12/**
13  * Init Controller to display next Button Template only
14  *
15  */
16class WorkstationProcessCancelNext extends BaseController
17{
18    /**
19     * @SuppressWarnings(Param)
20     * @return \Psr\Http\Message\ResponseInterface
21     */
22    #[\Override]
23    public function readResponse(
24        \Psr\Http\Message\RequestInterface $request,
25        \Psr\Http\Message\ResponseInterface $response,
26        array $args
27    ): \Psr\Http\Message\ResponseInterface {
28        $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 2])->getEntity();
29        $validator = $request->getAttribute('validator');
30        $excludedIds = ExcludeIds::fromQuery(
31            $validator->getParameter('exclude')->isString()->getValue()
32        );
33        if ($workstation->process['id']) {
34            \App::$http->readDeleteResult('/workstation/process/', ['action' => 'requeue_and_skip_to_next'])->getEntity();
35        }
36        return \BO\Slim\Render::redirect(
37            'workstationProcessNext',
38            array(),
39            array(
40                'exclude' => ExcludeIds::toQuery($excludedIds)
41            )
42        );
43    }
44}