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.

EditController::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
namespace flipbox\saml\idp\controllers\cp\view\keychain;
7
8
use craft\base\Plugin;
9
use flipbox\keychain\controllers\cp\view\AbstractEditController;
10
use flipbox\saml\idp\Saml;
11
12
class EditController extends AbstractEditController
13
{
14
    protected function getPlugin(): Plugin
15
    {
16
        return Saml::getInstance();
17
    }
18
19
    /**
20
     * @param array $variables
21
     * @return array
22
     */
23
    protected function beforeRender(array $variables = [])
24
    {
25
        $request = \Craft::$app->request;
26
27
        $key = null;
28
        $path = implode(
29
            '/',
30
            [
31
                $request->getSegment(2),
32
                $request->getSegment(3),
33
                $request->getSegment(4),
34
            ]
35
        );
36
37
        if (preg_match('#keychain/#', $path)) {
38
            $key = 'saml.keychain';
39
        }
40
41
        $variables['selectedSubnavItem'] = $key;
42
        return parent::beforeRender($variables);
43
    }
44
}
45