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.
Passed
Push — master ( 9587da...22648e )
by Steeven
02:05
created

Maintenance::index()   A

Complexity

Conditions 6
Paths 14

Size

Total Lines 17
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 6
eloc 9
nc 14
nop 0
dl 0
loc 17
rs 9.2222
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the O2System Framework package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @author         Steeve Andrian Salim
9
 * @copyright      Copyright (c) Steeve Andrian Salim
10
 */
11
12
// ------------------------------------------------------------------------
13
14
namespace O2System\Framework\Http\Controllers;
15
16
// ------------------------------------------------------------------------
17
18
use O2System\Framework\Http\Controller;
19
20
/**
21
 * Class Maintenance
22
 *
23
 * @package O2System\Framework\Http\Controllers
24
 */
25
class Maintenance extends Controller
26
{
27
    /**
28
     * Maintenance::$inherited
29
     *
30
     * Controller inherited flag.
31
     *
32
     * @var bool
33
     */
34
    static public $inherited = true;
35
36
    // ------------------------------------------------------------------------
37
38
    /**
39
     * Maintenance::index
40
     *
41
     * @param int $code
42
     */
43
    public function index()
44
    {
45
        if (presenter()->theme) {
46
            if (presenter()->theme->hasLayout('maintenance')) {
47
                presenter()->theme->setLayout('maintenance');
48
            }
49
50
            if (false !== ($layout = presenter()->theme->getLayout())) {
0 ignored issues
show
introduced by
The condition false !== $layout = pres...r()->theme->getLayout() is always true.
Loading history...
51
                if ($layout->getFilename() === 'theme') {
52
                    presenter()->setTheme(false);
0 ignored issues
show
Bug introduced by
false of type false is incompatible with the type string expected by parameter $theme of O2System\Framework\Http\Presenter::setTheme(). ( Ignorable by Annotation )

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

52
                    presenter()->setTheme(/** @scrutinizer ignore-type */ false);
Loading history...
53
                }
54
            }
55
        }
56
57
        if (cache()->hasItem('maintenance')) {
58
            $maintenanceInfo = cache()->getItem('maintenance')->get();
59
            view()->load('maintenance', $maintenanceInfo);
60
        }
61
    }
62
}