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 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 2
Bugs 2 Features 0
Metric Value
eloc 10
c 2
b 2
f 0
dl 0
loc 48
rs 10
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getClassInfo() 0 5 1
A __call() 0 4 2
A __get() 0 9 2
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\Kernel\Http;
15
16
// ------------------------------------------------------------------------
17
18
use O2System\Spl\Info\SplClassInfo;
19
20
/**
21
 * Class Controller
22
 *
23
 * @package O2System\Framework\Http
24
 */
25
class Controller
26
{
27
    /**
28
     * Controller::getClassInfo
29
     *
30
     * @return \O2System\Spl\Info\SplClassInfo
31
     */
32
    public function getClassInfo()
33
    {
34
        $classInfo = new SplClassInfo($this);
35
36
        return $classInfo;
37
    }
38
39
    // ------------------------------------------------------------------------
40
41
    /**
42
     * Controller::__get
43
     *
44
     * @param string $property
45
     *
46
     * @return mixed
47
     */
48
    public function &__get($property)
49
    {
50
        $get[ $property ] = false;
0 ignored issues
show
Comprehensibility Best Practice introduced by
$get was never initialized. Although not strictly required by PHP, it is generally a good practice to add $get = array(); before regardless.
Loading history...
51
52
        if (services()->has($property)) {
53
            $get[ $property ] = services()->get($property);
54
        }
55
56
        return $get[ $property ];
57
    }
58
59
    // ------------------------------------------------------------------------
60
61
    /**
62
     * Controller::__call
63
     *
64
     * @param string  $method
65
     * @param array   $args
66
     *
67
     * @return mixed
68
     */
69
    public function __call($method, array $args = [])
70
    {
71
        if (method_exists($this, $method)) {
72
            return call_user_func_array([$this, $method], $args);
73
        }
74
    }
75
}