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 ( 9c3470...c852c0 )
by
unknown
02:52
created

Pages::setPage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the O2System PHP 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
use O2System\Framework\Http\Router\Datastructures\Page;
20
21
/**
22
 * Class Pages
23
 *
24
 * @package O2System\Framework\Http\Controllers
25
 */
26
class Pages extends Controller
27
{
28
    /**
29
     * Pages Page
30
     *
31
     * @var Page
32
     */
33
    protected $page;
34
35
    // ------------------------------------------------------------------------
36
37
    /**
38
     * Pages::setPage
39
     *
40
     * @param \O2System\Framework\Http\Router\Datastructures\Page $page
41
     *
42
     * @return void
43
     */
44
    public function setPage(Page $page)
45
    {
46
        $this->page = $page;
47
    }
48
49
    // ------------------------------------------------------------------------
50
51
    /**
52
     * Pages::index
53
     *
54
     * @return void
55
     */
56
    public function index()
57
    {
58
        if (false !== ($settings = $this->page->getSettings())) {
0 ignored issues
show
introduced by
The condition false !== $settings = $this->page->getSettings() is always true.
Loading history...
59
            if ($settings->offsetExists('theme')) {
60
                presenter()->theme->set($settings->theme);
0 ignored issues
show
Bug introduced by
The method set() does not exist on null. ( Ignorable by Annotation )

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

60
                presenter()->theme->/** @scrutinizer ignore-call */ 
61
                                    set($settings->theme);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug Best Practice introduced by
The property theme does not exist on O2System\Framework\Http\Presenter. Since you implemented __get, consider adding a @property annotation.
Loading history...
61
            }
62
63
            if ($settings->offsetExists('layout')) {
64
                presenter()->theme->setLayout($settings->layout);
65
            }
66
67
            if ($settings->offsetExists('title')) {
68
                presenter()->meta->title->append($settings->title);
0 ignored issues
show
Bug Best Practice introduced by
The property meta does not exist on O2System\Framework\Http\Presenter. Since you implemented __get, consider adding a @property annotation.
Loading history...
69
            }
70
71
            if ($settings->offsetExists('pageTitle')) {
72
                presenter()->meta->title->append($settings->pageTitle);
73
            }
74
75
            if ($settings->offsetExists('browserTitle')) {
76
                presenter()->meta->title->replace($settings->browserTitle);
77
            }
78
        }
79
80
        view()->page($this->page);
81
    }
82
}