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 ( 09ff6d...312062 )
by
unknown
02:21
created

globals()   A

Complexity

Conditions 5
Paths 5

Size

Total Lines 19
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 5
eloc 9
nc 5
nop 1
dl 0
loc 19
rs 9.6111
c 2
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
if (!function_exists('kernel')) {
14
    /**
15
     * kernel
16
     *
17
     * Convenient shortcut for O2System Kernel Instance
18
     *
19
     * @return O2System\Kernel
20
     */
21
    function kernel()
22
    {
23
        if (class_exists('O2System\Framework', false)) {
24
            return O2System\Framework::getInstance();
0 ignored issues
show
Bug introduced by
The type O2System\Framework was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
25
        } else if (class_exists('O2System\Reactor', false)) {
26
            return O2System\Reactor::getInstance();
0 ignored issues
show
Bug introduced by
The type O2System\Reactor was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
27
        }
28
29
        return O2System\Kernel::getInstance();
30
    }
31
}
32
33
// ------------------------------------------------------------------------
34
35
36
if (!function_exists('services')) {
37
    /**
38
     * services
39
     *
40
     * Convenient shortcut for O2System Framework Services container.
41
     *
42
     * @return mixed|\O2System\Kernel\Containers\Services
43
     */
44
    function services()
45
    {
46
        $args = func_get_args();
47
48
        if (count($args)) {
49
            if (kernel()->services->has($args[0])) {
50
                if(isset($args[1]) and is_array($args[1])) {
51
                    return kernel()->services->get($args[0], $args[1]);
52
                }
53
                return kernel()->services->get($args[0]);
54
            }
55
56
            return false;
57
        }
58
59
        return kernel()->services;
60
    }
61
}
62
63
// ------------------------------------------------------------------------
64
65
if (!function_exists('profiler')) {
66
    /**
67
     * profiler
68
     *
69
     * Convenient shortcut for O2System Gear Profiler service.
70
     *
71
     * @return O2System\Gear\Profiler
72
     */
73
    function profiler()
74
    {
75
        return services('profiler');
0 ignored issues
show
Bug Best Practice introduced by
The expression return services('profiler') also could return the type O2System\Kernel\Containers\Services which is incompatible with the documented return type O2System\Gear\Profiler.
Loading history...
76
    }
77
}
78
79
// ------------------------------------------------------------------------
80
81
if (!function_exists('language')) {
82
    /**
83
     * language
84
     *
85
     * Convenient shortcut for O2System Kernel Language service.
86
     *
87
     * @return O2System\Kernel\Services\Language|O2System\Framework\Services\Language
0 ignored issues
show
Bug introduced by
The type O2System\Framework\Services\Language was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
88
     */
89
    function language()
90
    {
91
        $args = func_get_args();
92
93
        if (count($args)) {
94
            if (services()->has('language')) {
95
                $language =& kernel()->services->get('language');
96
97
                return call_user_func_array([&$language, 'getLine'], $args);
98
            }
99
100
            return false;
0 ignored issues
show
Bug Best Practice introduced by
The expression return false returns the type false which is incompatible with the documented return type O2System\Framework\Servi...ernel\Services\Language.
Loading history...
101
        }
102
103
        return services('language');
0 ignored issues
show
Bug Best Practice introduced by
The expression return services('language') also could return the type O2System\Kernel\Containers\Services which is incompatible with the documented return type O2System\Framework\Servi...ernel\Services\Language.
Loading history...
104
    }
105
}
106
107
// ------------------------------------------------------------------------
108
109
if (!function_exists('logger')) {
110
    /**
111
     * logger
112
     *
113
     * Convenient shortcut for O2System Kernel Logger service.
114
     *
115
     * @return O2System\Kernel\Services\Logger
116
     */
117
    function logger()
118
    {
119
        $args = func_get_args();
120
121
        if (count($args)) {
122
            if (services()->has('logger')) {
123
                $logger =& services('logger');
124
125
                return call_user_func_array([&$logger, 'log'], $args);
126
            }
127
128
            return false;
0 ignored issues
show
Bug Best Practice introduced by
The expression return false returns the type false which is incompatible with the documented return type O2System\Kernel\Services\Logger.
Loading history...
129
        }
130
131
        return services('logger');
0 ignored issues
show
Bug Best Practice introduced by
The expression return services('logger') also could return the type O2System\Kernel\Containers\Services which is incompatible with the documented return type O2System\Kernel\Services\Logger.
Loading history...
132
    }
133
}
134
135
// ------------------------------------------------------------------------
136
137
if (!function_exists('shutdown')) {
138
    /**
139
     * shutdown
140
     *
141
     * Convenient shortcut for O2System Kernel Shutdown service.
142
     *
143
     * @return O2System\Kernel\Services\Shutdown
144
     */
145
    function shutdown()
146
    {
147
        return services('shutdown');
0 ignored issues
show
Bug Best Practice introduced by
The expression return services('shutdown') also could return the type O2System\Kernel\Containers\Services which is incompatible with the documented return type O2System\Kernel\Services\Shutdown.
Loading history...
148
    }
149
}
150
151
// ------------------------------------------------------------------------
152
153
if (!function_exists('input')) {
154
    /**
155
     * input
156
     *
157
     * Convenient shortcut for O2System Kernel Input Instance
158
     *
159
     * @return O2System\Kernel\Http\Input|O2System\Kernel\Cli\Input
160
     */
161
    function input()
162
    {
163
        return services('input');
0 ignored issues
show
Bug Best Practice introduced by
The expression return services('input') also could return the type O2System\Kernel\Containers\Services which is incompatible with the documented return type O2System\Kernel\Cli\Inpu...ystem\Kernel\Http\Input.
Loading history...
164
    }
165
}
166
167
// ------------------------------------------------------------------------
168
169
if (!function_exists('output')) {
170
    /**
171
     * output
172
     *
173
     * Convenient shortcut for O2System Kernel Browser Instance
174
     *
175
     * @return O2System\Kernel\Http\Output|O2System\Kernel\Cli\Output
176
     */
177
    function output()
178
    {
179
        return services('output');
0 ignored issues
show
Bug Best Practice introduced by
The expression return services('output') also could return the type O2System\Kernel\Containers\Services which is incompatible with the documented return type O2System\Kernel\Cli\Outp...stem\Kernel\Http\Output.
Loading history...
180
    }
181
}
182
183
// ------------------------------------------------------------------------
184
185
if (!function_exists('server_request')) {
186
    /**
187
     * server_request
188
     *
189
     * Convenient shortcut for O2System Kernel Http Message Request service.
190
     *
191
     * @return O2System\Kernel\Http\Message\Request
192
     */
193
    function server_request()
194
    {
195
        if (function_exists('o2system')) {
196
            if (!services()->has('serverRequest')) {
197
                services()->load(new \O2System\Kernel\Http\Message\ServerRequest(), 'serverRequest');
0 ignored issues
show
Bug introduced by
new O2System\Kernel\Http\Message\ServerRequest() of type O2System\Kernel\Http\Message\ServerRequest is incompatible with the type string expected by parameter $service of O2System\Kernel\Containers\Services::load(). ( Ignorable by Annotation )

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

197
                services()->load(/** @scrutinizer ignore-type */ new \O2System\Kernel\Http\Message\ServerRequest(), 'serverRequest');
Loading history...
198
            }
199
200
            return services('serverRequest');
0 ignored issues
show
Bug Best Practice introduced by
The expression return services('serverRequest') also could return the type O2System\Kernel\Containers\Services which is incompatible with the documented return type O2System\Kernel\Http\Message\Request.
Loading history...
201
        } else {
202
            if (!services()->has('serverRequest')) {
203
                services()->load(new \O2System\Kernel\Http\Message\ServerRequest(), 'serverRequest');
204
            }
205
206
            return services('serverRequest');
0 ignored issues
show
Bug Best Practice introduced by
The expression return services('serverRequest') also could return the type O2System\Kernel\Containers\Services which is incompatible with the documented return type O2System\Kernel\Http\Message\Request.
Loading history...
207
        }
208
    }
209
}
210