Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
17 / 17
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
Changelog
100.00% covered (success)
100.00%
17 / 17
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
1 / 1
 readResponse
100.00% covered (success)
100.00%
17 / 17
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2
3/**
4 * @package Zmsstatistic
5 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
6 **/
7
8namespace BO\Zmsstatistic;
9
10use BO\Zmsstatistic\Helper\ChangelogHelper;
11
12class Changelog extends BaseController
13{
14    protected $withAccess = false;
15
16    /**
17     * @SuppressWarnings(Param)
18     * @return \Psr\Http\Message\ResponseInterface
19     */
20    #[\Override]
21    public function readResponse(
22        \Psr\Http\Message\RequestInterface $request,
23        \Psr\Http\Message\ResponseInterface $response,
24        array $args
25    ): \Psr\Http\Message\ResponseInterface {
26        try {
27            $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 1])->getEntity();
28        } catch (\Exception $workstationexception) {
29            $workstation = null;
30        }
31
32        $changelogHelper = new ChangelogHelper();
33        $changelogContent = $changelogHelper->getChangelogHtml();
34         //TODO: Check if safe when refactoring to vue.js in the future
35        $config = \App::$http->readGetResult('/config/', [], \App::CONFIG_SECURE_TOKEN)->getEntity();
36
37        return \BO\Slim\Render::withHtml(
38            $response,
39            'page/changelog.twig',
40            array(
41                'title' => 'Changelog',
42                'menuActive' => 'changelog',
43                'workstation' => $workstation,
44                'changelogContent' => $changelogContent,
45                'config' => $config
46            )
47        );
48    }
49}