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.

Controller   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 5
dl 0
loc 26
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 3
1
<?php
2
3
/**
4
 * This is the "base controller class". All other "real" controllers extend this class.
5
 * Whenever a controller is created, we also
6
 * 1. initialize a session
7
 * 2. check if the user is not logged in anymore (session timeout) but has a cookie
8
 */
9
class Controller
10
{
11
    /** @var View View The view object */
12
    public $View;
13
14
    /**
15
     * Construct the (base) controller. This happens when a real controller is constructed, like in
16
     * the constructor of IndexController when it says: parent::__construct();
17
     */
18
    public function __construct()
19
    {
20
        // always initialize a session
21
        Session::init();
22
23
        // check session concurrency
24
        Auth::checkSessionConcurrency();
25
26
        // user is not logged in but has remember-me-cookie ? then try to login with cookie ("remember me" feature)
27
        if (!Session::userIsLoggedIn() AND Request::cookie('remember_me')) {
28
            header('location: ' . Config::get('URL') . 'login/loginWithCookie');
29
        }
30
31
        // create a view object to be able to use it inside a controller, like $this->View->render();
32
        $this->View = new View();
33
    }
34
}
35