Lines 91.66% 11 / 12
Functions and Methods 0.00% 0 / 1
Classes and Traits 0.00% 0 / 1
Name Lines Functions and Methods CRAP Classes and Traits
Dayoff 91.66% 11 / 12 0.00% 0 / 1 2.00 0.00% 0 / 1
 readResponse 91.66% 11 / 12 0.00% 0 / 1 2.00
1<?php
2
3/**
4 * @package Zmsadmin
5 * @copyright BerlinOnline Stadtportal GmbH & Co. KG
6 **/
7
8namespace BO\Zmsadmin;
9
10use BO\Zmsentities\Exception\UserAccountMissingRights;
11
12class Dayoff 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(['dayoff'])) {
26            throw new UserAccountMissingRights();
27        }
28        return \BO\Slim\Render::withHtml(
29            $response,
30            'page/dayoff.twig',
31            array(
32                'title' => 'Allgemein gültige Feiertage - Jahresauswahl',
33                'workstation' => $workstation,
34                'menuActive' => 'dayoff'
35            )
36        );
37    }
38}