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