Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
13 / 13
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
Logout
100.00% covered (success)
100.00%
13 / 13
100.00% covered (success)
100.00%
1 / 1
3
100.00% covered (success)
100.00%
1 / 1
 readResponse
100.00% covered (success)
100.00%
13 / 13
100.00% covered (success)
100.00%
1 / 1
3
1<?php
2
3/**
4 * @package Zmsadmin
5 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
6 **/
7
8namespace BO\Zmsadmin;
9
10use BO\Zmsclient\Auth;
11
12class Logout extends BaseController
13{
14    /**
15     * @SuppressWarnings(Param)
16     * @return String
17     */
18    public function readResponse(
19        \Psr\Http\Message\RequestInterface $request,
20        \Psr\Http\Message\ResponseInterface $response,
21        array $args
22    ) {
23        try {
24            $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 0])->getEntity();
25            \App::$http->readDeleteResult('/workstation/login/' . $workstation->useraccount['id'] . '/')->getEntity();
26        } catch (\BO\Zmsclient\Exception $exception) {
27            if ("BO\Zmsentities\Exception\UseraccountMissingLogin" !== $exception->template) {
28                throw $exception;
29            }
30        }
31        \BO\Zmsclient\Auth::removeKey();
32        return \BO\Slim\Render::withHtml(
33            $response,
34            'page/logout.twig',
35            array(
36                'title' => 'Erfolgreich abgemeldet'
37            )
38        );
39    }
40}