Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| ScopeAvailabilityDayClosure | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| readResponse | |
0.00% |
0 / 12 |
|
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\Slim\Render; |
| 11 | use BO\Zmsdb\Closure; |
| 12 | use BO\Zmsentities\Collection\AvailabilityList; |
| 13 | use Psr\Http\Message\ResponseInterface; |
| 14 | |
| 15 | class ScopeAvailabilityDayClosure extends BaseController |
| 16 | { |
| 17 | /** |
| 18 | * @SuppressWarnings(Param) |
| 19 | * @return ResponseInterface |
| 20 | */ |
| 21 | public function readResponse( |
| 22 | \Psr\Http\Message\RequestInterface $request, |
| 23 | \Psr\Http\Message\ResponseInterface $response, |
| 24 | array $args |
| 25 | ): ResponseInterface { |
| 26 | $scopeId = $args['id']; |
| 27 | $date = $args['date']; |
| 28 | |
| 29 | $closureToggled = \App::$http->readPostResult( |
| 30 | '/scope/' . $scopeId . '/availability/' . $date . '/closure/toggle/', |
| 31 | new \BO\Zmsentities\Closure() |
| 32 | )->getEntity(); |
| 33 | |
| 34 | return \BO\Slim\Render::withJson( |
| 35 | $response, |
| 36 | [ |
| 37 | 'closure' => $closureToggled |
| 38 | ] |
| 39 | ); |
| 40 | } |
| 41 | } |