GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

IndexController::beforeRender()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 21

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 21
ccs 0
cts 18
cp 0
rs 9.584
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 6
1
<?php
2
/**
3
 * @copyright  Copyright (c) Flipbox Digital Limited
4
 */
5
6
7
namespace flipbox\saml\idp\controllers\cp\view\keychain;
8
9
use craft\base\Plugin;
10
use flipbox\keychain\controllers\cp\view\AbstractGeneralController;
11
use flipbox\saml\idp\Saml;
12
13
class IndexController extends AbstractGeneralController
14
{
15
    /**
16
     * @return Plugin
17
     */
18
    protected function getPlugin(): Plugin
19
    {
20
        return Saml::getInstance();
21
    }
22
23
    /**
24
     * @param array $variables
25
     * @return array
26
     */
27
    protected function beforeRender(array $variables = [])
28
    {
29
        $request = \Craft::$app->request;
30
31
        $key = null;
32
        $path = implode(
33
            '/',
34
            [
35
                $request->getSegment(2),
36
                $request->getSegment(3),
37
                $request->getSegment(4),
38
            ]
39
        );
40
41
        if (preg_match('#keychain/+$#', $path)) {
42
            $key = 'saml.keychain';
43
        }
44
45
        $variables['selectedSubnavItem'] = $key;
46
        return parent::beforeRender($variables);
47
    }
48
}
49