Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
14 / 14
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
SourceIndex
100.00% covered (success)
100.00%
14 / 14
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
1 / 1
 readResponse
100.00% covered (success)
100.00%
14 / 14
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2
3/**
4 *
5 * @package Zmsadmin
6 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
7 *
8 */
9
10namespace BO\Zmsadmin;
11
12class SourceIndex 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        $workstation = \App::$http->readGetResult('/workstation/', ['resolveReferences' => 1])->getEntity();
25        if (!$workstation->getUseraccount()->hasPermissions(['source'])) {
26            throw new \BO\Zmsentities\Exception\UserAccountMissingRights();
27        }
28        $sourceList = \App::$http->readGetResult('/source/', ['resolveReferences' => 0])->getCollection();
29
30        return \BO\Slim\Render::withHtml(
31            $response,
32            'page/sourceindex.twig',
33            array(
34                'title' => 'Mandanten',
35                'menuActive' => 'source',
36                'workstation' => $workstation,
37                'sourceList' => $sourceList
38            )
39        );
40    }
41}