Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
21 / 21 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| NotificationAmendment | |
100.00% |
21 / 21 |
|
100.00% |
1 / 1 |
3 | |
100.00% |
1 / 1 |
| readResponse | |
100.00% |
21 / 21 |
|
100.00% |
1 / 1 |
3 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * |
| 5 | * @package Zmsticketprinter |
| 6 | * @copyright BerlinOnline Stadtportal GmbH & Co. KG |
| 7 | * |
| 8 | */ |
| 9 | |
| 10 | namespace BO\Zmsticketprinter; |
| 11 | |
| 12 | use BO\Slim\Render; |
| 13 | use Psr\Http\Message\RequestInterface; |
| 14 | use Psr\Http\Message\ResponseInterface; |
| 15 | |
| 16 | class NotificationAmendment extends BaseController |
| 17 | { |
| 18 | /** |
| 19 | * @SuppressWarnings(UnusedFormalParameter) |
| 20 | * @return ResponseInterface |
| 21 | */ |
| 22 | public function readResponse( |
| 23 | RequestInterface $request, |
| 24 | ResponseInterface $response, |
| 25 | array $args |
| 26 | ) { |
| 27 | $validator = $request->getAttribute('validator'); |
| 28 | $scopeId = $validator->getParameter('scopeId')->isNumber()->getValue(); |
| 29 | $clusterId = $validator->getParameter('clusterId')->isNumber()->getValue(); |
| 30 | $ticketprinter = (new Helper\Ticketprinter($args, $request))->getEntity(); |
| 31 | |
| 32 | $scope = ($scopeId) ? \App::$http->readGetResult('/scope/' . $scopeId . '/')->getEntity() : null; |
| 33 | $cluster = ($clusterId) ? \App::$http->readGetResult('/cluster/' . $clusterId . '/')->getEntity() : null; |
| 34 | |
| 35 | return Render::withHtml( |
| 36 | $response, |
| 37 | 'page/notificationAmendment.twig', |
| 38 | array( |
| 39 | 'debug' => \App::DEBUG, |
| 40 | 'title' => 'Anmeldung an der Warteschlange', |
| 41 | 'ticketprinter' => $ticketprinter, |
| 42 | 'scope' => $scope, |
| 43 | 'cluster' => $cluster, |
| 44 | 'organisation' => \App::$http->readGetResult( |
| 45 | '/scope/' . $scopeId . '/organisation/', |
| 46 | ['resolveReferences' => 2] |
| 47 | )->getEntity(), |
| 48 | ) |
| 49 | ); |
| 50 | } |
| 51 | } |