Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
19 / 19
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
PickupDelete
100.00% covered (success)
100.00%
19 / 19
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 readResponse
100.00% covered (success)
100.00%
19 / 19
100.00% covered (success)
100.00%
1 / 1
1
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 PickupDelete 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        $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 2])->getEntity();
24        $processId = Validator::value($args['id'])->isNumber()->getValue();
25        $deleteList = Validator::param('list')->isNumber()->getValue();
26        $process = \App::$http->readGetResult('/process/' . $processId . '/')->getEntity();
27        $process->status = 'finished';
28        \App::$http->readDeleteResult('/workstation/process/');
29        $processArchived = \App::$http
30            ->readPostResult('/process/status/finished/', $process, ['survey' => 0])
31            ->getEntity();
32
33        return \BO\Slim\Render::withHtml(
34            $response,
35            'block/pickup/deleted.twig',
36            array(
37                'deleteList' => $deleteList,
38                'workstation' => $workstation,
39                'process' => $process,
40                'archive' => $processArchived,
41            )
42        );
43    }
44}