Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
AvailabilityUpdateSingle | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
readResponse | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | /** |
4 | * @package Zmsadmin |
5 | * @copyright BerlinOnline Stadtportal GmbH & Co. KG |
6 | **/ |
7 | |
8 | namespace BO\Zmsadmin; |
9 | |
10 | use BO\Zmsentities\Availability as Entity; |
11 | use Psr\Http\Message\RequestInterface; |
12 | use Psr\Http\Message\ResponseInterface; |
13 | use BO\Slim\Render; |
14 | |
15 | /** |
16 | * Update availabilites, API proxy |
17 | * |
18 | */ |
19 | class AvailabilityUpdateSingle extends BaseController |
20 | { |
21 | /** |
22 | * @SuppressWarnings(UnusedFormalParameter) |
23 | * @return ResponseInterface |
24 | */ |
25 | public function readResponse( |
26 | RequestInterface $request, |
27 | ResponseInterface $response, |
28 | array $args |
29 | ): ResponseInterface { |
30 | $validator = $request->getAttribute('validator'); |
31 | $input = $validator->getInput()->isJson()->assertValid()->getValue(); |
32 | $entity = new Entity($input); |
33 | $availability = \App::$http->readPostResult('/availability/' . $args['id'] . '/', $entity)->getEntity(); |
34 | $response = Render::withLastModified($response, time(), '0'); |
35 | return Render::withJson($response, $availability); |
36 | } |
37 | } |