Lines
100.00%
17 / 17
Functions and Methods
100.00%
1 / 1
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Changelog | 100.00% | 17 / 17 | 100.00% | 1 / 1 | 2 | 100.00% | 1 / 1 | |||
| readResponse | 100.00% | 17 / 17 | 100.00% | 1 / 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\Zmsadmin\Helper\ChangelogHelper; | |
| 11 | ||
| 12 | class Changelog extends BaseController | |
| 13 | { | |
| 14 | /** | |
| 15 | * @SuppressWarnings(Param) | |
| 16 | * @return \Psr\Http\Message\ResponseInterface | |
| 17 | */ | |
| 18 | #[\Override] | |
| 19 | public function readResponse( | |
| 20 | \Psr\Http\Message\RequestInterface $request, | |
| 21 | \Psr\Http\Message\ResponseInterface $response, | |
| 22 | array $args | |
| 23 | ): \Psr\Http\Message\ResponseInterface { | |
| 24 | try { | |
| 25 | $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 1])->getEntity(); | |
| 26 | } catch (\Exception $workstationexception) { | |
| 27 | $workstation = null; | |
| 28 | } | |
| 29 | ||
| 30 | $changelogHelper = new ChangelogHelper(); | |
| 31 | $changelogContent = $changelogHelper->getChangelogHtml(); | |
| 32 | //TODO: Check if safe when refactoring to vue.js in the future | |
| 33 | $config = \App::$http->readGetResult('/config/', [], \App::CONFIG_SECURE_TOKEN)->getEntity(); | |
| 34 | ||
| 35 | return \BO\Slim\Render::withHtml( | |
| 36 | $response, | |
| 37 | 'page/changelog.twig', | |
| 38 | array( | |
| 39 | 'title' => 'Changelog', | |
| 40 | 'menuActive' => 'changelog', | |
| 41 | 'workstation' => $workstation, | |
| 42 | 'changelogContent' => $changelogContent, | |
| 43 | 'config' => $config | |
| 44 | ) | |
| 45 | ); | |
| 46 | } | |
| 47 | } |