LoggedInController::main()   A
last analyzed

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
use function session_cache_limiter;
14
15
#[AsController]
16
class LoggedInController
17
{
18
    /** @var \SimpleSAML\Configuration */
19
    protected Configuration $config;
20
21
    /**
22
     * Controller constructor.
23
     *
24
     * It initializes the global configuration for the controllers implemented here and injects the session service.
25
     *
26
     * @param \SimpleSAML\Configuration|null $config
27
     *
28
     * @throws \Exception
29
     */
30
    public function __construct(?Configuration $config = null)
31
    {
32
        $this->config = $config ?? Configuration::getInstance();
33
    }
34
35
    /**
36
     * Show Log out view.
37
     *
38
     * @param \Symfony\Component\HttpFoundation\Request $request
39
     * @return \Symfony\Component\HttpFoundation\Response
40
     * @throws \Exception
41
     */
42
    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

42
    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...
43
    {
44
        session_cache_limiter('nocache');
45
        return new Template($this->config, 'casserver:loggedIn.twig');
46
    }
47
}
48