Passed
Push — master ( 81b6b5...5b35ab )
by Tim
03:44
created

LoggedInController::main()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
nc 1
nop 1
cc 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\Module\casserver\Controller;
6
7
use SimpleSAML\Configuration;
8
use SimpleSAML\XHTML\Template;
9
use Symfony\Component\HttpFoundation\Request;
10
use Symfony\Component\HttpFoundation\Response;
11
use Symfony\Component\HttpKernel\Attribute\AsController;
12
13
#[AsController]
14
class LoggedInController
15
{
16
    /** @var \SimpleSAML\Configuration */
17
    protected Configuration $config;
18
19
    /**
20
     * Controller constructor.
21
     *
22
     * It initializes the global configuration for the controllers implemented here and injects the session service.
23
     *
24
     * @param   Configuration|null  $config
25
     *
26
     * @throws \Exception
27
     */
28
    public function __construct(Configuration $config = null)
29
    {
30
        $this->config = $config ?? Configuration::getInstance();
31
    }
32
33
    /**
34
     * Show Log out view.
35
     *
36
     * @param   Request  $request
37
     * @return Response
38
     * @throws \Exception
39
     */
40
    public function main(Request $request): Response
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

40
    public function main(/** @scrutinizer ignore-unused */ Request $request): Response

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
41
    {
42
        session_cache_limiter('nocache');
43
        return new Template($this->config, 'casserver:loggedIn.twig');
44
    }
45
}
46