Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
11 / 11
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
WorkstationProcessWaitingnumber
100.00% covered (success)
100.00%
11 / 11
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 readResponse
100.00% covered (success)
100.00%
11 / 11
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3/**
4 * @package ZMS API
5 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
6 **/
7
8namespace BO\Zmsapi;
9
10use BO\Slim\Render;
11use BO\Mellon\Validator;
12use BO\Zmsdb\ProcessStatusQueued;
13
14/**
15 * @SuppressWarnings(Coupling)
16 */
17class WorkstationProcessWaitingnumber extends BaseController
18{
19    /**
20     * @SuppressWarnings(Param)
21     * @return \Psr\Http\Message\ResponseInterface
22     */
23    #[\Override]
24    public function readResponse(
25        \Psr\Http\Message\RequestInterface $request,
26        \Psr\Http\Message\ResponseInterface $response,
27        array $args
28    ) {
29        \BO\Zmsdb\Connection\Select::getWriteConnection();
30        (new Helper\User($request))->checkPermissions();
31        $input = Validator::input()->isJson()->assertValid()->getValue();
32        $process = new \BO\Zmsentities\Process($input);
33        $process = ProcessStatusQueued::init()->writeNewFromAdmin($process, \App::$now);
34        $process->testValid();
35        $message = Response\Message::create($request);
36        $message->data = $process;
37
38        $response = Render::withLastModified($response, time(), '0');
39        $response = Render::withJson($response, $message->setUpdatedMetaData(), $message->getStatuscode());
40        return $response;
41    }
42}