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