Lines
0.00%
0 / 12
Functions and Methods
0.00%
0 / 1
Classes and Traits
0.00%
0 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 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\Zmsentities\Closure; | |
| 12 | use Psr\Http\Message\ResponseInterface; | |
| 13 | ||
| 14 | class ScopeAvailabilityDayClosure extends BaseController | |
| 15 | { | |
| 16 | /** | |
| 17 | * @SuppressWarnings(Param) | |
| 18 | * @return ResponseInterface | |
| 19 | */ | |
| 20 | #[\Override] | |
| 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 | } |