Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
18 / 18
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
WorkstationProcessCall
100.00% covered (success)
100.00%
18 / 18
100.00% covered (success)
100.00%
1 / 1
3
100.00% covered (success)
100.00%
1 / 1
 readResponse
100.00% covered (success)
100.00%
18 / 18
100.00% covered (success)
100.00%
1 / 1
3
1<?php
2
3/**
4 * @package Zmsadmin
5 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
6 **/
7
8namespace BO\Zmsadmin;
9
10use BO\Mellon\Validator;
11
12class WorkstationProcessCall extends BaseController
13{
14    /**
15     * @SuppressWarnings(Param)
16     * @return String
17     */
18    public function readResponse(
19        \Psr\Http\Message\RequestInterface $request,
20        \Psr\Http\Message\ResponseInterface $response,
21        array $args
22    ) {
23        \App::$http->readGetResult('/workstation/', ['resolveReferences' => 1])->getEntity();
24        $processId = Validator::value($args['id'])->isNumber()->getValue();
25        $validator = $request->getAttribute('validator');
26        $isDirectCall = $validator->getParameter('direct')->isNumber()->getValue();
27        $process = \App::$http->readGetResult('/process/' . $processId . '/')->getEntity();
28        if ($process->toProperty()->amendment->get() && ! $isDirectCall) {
29            return \BO\Slim\Render::redirect(
30                'workstationProcessPreCall',
31                array(
32                    'id' => $process->id
33                )
34            );
35        }
36        return \BO\Slim\Render::redirect(
37            'workstationProcessCalled',
38            array(
39                'id' => $process->id
40            )
41        );
42    }
43}