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\Zmsbackend\Workstation\Api;
9
10use BO\Slim\Render;
11use BO\Mellon\Validator;
12
13/**
14 * @SuppressWarnings(Coupling)
15 */
16class WorkstationProcessWaitingnumber extends \BO\Zmsbackend\Api\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    ) {
28        \BO\Zmsbackend\Connection\Select::getWriteConnection();
29        (new \BO\Zmsbackend\Helper\User($request))->checkPermissions();
30        $input = Validator::input()->isJson()->assertValid()->getValue();
31        $process = new \BO\Zmsentities\Process($input);
32        $process = \BO\Zmsbackend\Process\Service\ProcessStatusQueued::init()->writeNewFromAdmin($process, \App::$now);
33        $process->testValid();
34        $message = \BO\Zmsbackend\Api\Response\Message::create($request);
35        $message->data = $process;
36
37        $response = Render::withLastModified($response, time(), '0');
38        $response = Render::withJson($response, $message->setUpdatedMetaData(), $message->getStatuscode());
39        return $response;
40    }
41}