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 ( e22738...bc2961 )
by
unknown
01:53
created

hooks()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 7
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
if ( ! function_exists('o2system')) {
14
    /**
15
     * o2system
16
     *
17
     * Convenient shortcut for O2System Framework Instance
18
     *
19
     * @return O2System\Framework
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...
20
     */
21
    function o2system()
22
    {
23
        return O2System\Reactor::getInstance();
0 ignored issues
show
Bug Best Practice introduced by
The expression return O2System\Reactor::getInstance() returns the type O2System\Reactor which is incompatible with the documented return type O2System\Framework.
Loading history...
24
    }
25
}
26
27
// ------------------------------------------------------------------------
28
29
if ( ! function_exists('loader')) {
30
    /**
31
     * loader
32
     *
33
     * Convenient shortcut for O2System Framework Loader service.
34
     *
35
     * @return O2System\Framework\Services\Loader
0 ignored issues
show
Bug introduced by
The type O2System\Framework\Services\Loader 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...
36
     */
37
    function loader()
38
    {
39
        return services('loader');
0 ignored issues
show
Bug Best Practice introduced by
The expression return services('loader') also could return the type O2System\Kernel\Containers\Services which is incompatible with the documented return type O2System\Framework\Services\Loader.
Loading history...
40
    }
41
}
42
43
// ------------------------------------------------------------------------
44
45
if ( ! function_exists('config')) {
46
    /**
47
     * config
48
     *
49
     * Convenient shortcut for O2System Framework Config service.
50
     *
51
     * @return O2System\Framework\Services\Config|\O2System\Kernel\Datastructures\Config
0 ignored issues
show
Bug introduced by
The type O2System\Framework\Services\Config 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...
52
     */
53
    function config()
54
    {
55
        $args = func_get_args();
56
57
        if ($countArgs = count($args)) {
58
            if(services()->has('config')) {
59
                $config = services('config');
60
61
                if ($countArgs == 1) {
62
                    return call_user_func_array([&$config, 'getItem'], $args);
63
                } else {
64
                    return call_user_func_array([&$config, 'loadFile'], $args);
65
                }
66
            }
67
        }
68
69
        return services('config');
0 ignored issues
show
Bug Best Practice introduced by
The expression return services('config') also could return the type O2System\Kernel\Containers\Services which is incompatible with the documented return type O2System\Framework\Servi...l\Datastructures\Config.
Loading history...
70
    }
71
}
72
73
// ------------------------------------------------------------------------
74
75
if ( ! function_exists('cache')) {
76
    /**
77
     * cache
78
     *
79
     * Convenient shortcut for O2System Framework Cache service.
80
     *
81
     * @return O2System\Framework\Services\Cache|boolean Returns FALSE if service not exists.
0 ignored issues
show
Bug introduced by
The type O2System\Framework\Services\Cache 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...
82
     */
83
    function cache()
84
    {
85
        if(services()->has('cache')) {
86
            return services()->get('cache');
87
        }
88
89
        return false;
90
    }
91
}
92
93
// ------------------------------------------------------------------------
94
95
if ( ! function_exists('hooks')) {
96
    /**
97
     * hooks
98
     *
99
     * Convenient shortcut for O2System Framework Hooks service.
100
     *
101
     * @return O2System\Framework\Services\Hooks Returns FALSE if service not exists.
0 ignored issues
show
Bug introduced by
The type O2System\Framework\Services\Hooks 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...
102
     */
103
    function hooks()
104
    {
105
        if(services()->has('hooks')) {
106
            return services()->get('hooks');
107
        }
108
109
        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\Services\Hooks.
Loading history...
110
    }
111
}
112
113
// ------------------------------------------------------------------------
114
115
if ( ! function_exists('database')) {
116
    /**
117
     * database
118
     *
119
     * Convenient shortcut for O2System Framework Database Connection pools.
120
     *
121
     * @return O2System\Database\Connections
122
     */
123
    function database()
124
    {
125
        return models()->database;
126
    }
127
}
128
129
// ------------------------------------------------------------------------
130
131
if ( ! function_exists('models')) {
132
    /**
133
     * models
134
     *
135
     * Convenient shortcut for O2System Framework Models container.
136
     *
137
     * @return O2System\Framework\Containers\Models|O2System\Framework\Models\Sql\Model|O2System\Framework\Models\NoSql\Model
0 ignored issues
show
Bug introduced by
The type O2System\Framework\Models\NoSql\Model 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...
Bug introduced by
The type O2System\Framework\Containers\Models 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...
Bug introduced by
The type O2System\Framework\Models\Sql\Model 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...
138
     */
139
    function models()
140
    {
141
        $args = func_get_args();
142
143
        if (count($args)) {
144
            return o2system()->models->get($args[ 0 ]);
145
        }
146
147
        return o2system()->models;
148
    }
149
}
150
151
// ------------------------------------------------------------------------
152
153
if ( ! function_exists('router')) {
154
    /**
155
     * router
156
     *
157
     * Convenient shortcut for O2System Framework Router service.
158
     *
159
     * @return O2System\Framework\Http\Router|O2System\Framework\Cli\Router
0 ignored issues
show
Bug introduced by
The type O2System\Framework\Http\Router 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...
Bug introduced by
The type O2System\Framework\Cli\Router 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...
160
     */
161
    function router()
162
    {
163
        return services('router');
0 ignored issues
show
Bug Best Practice introduced by
The expression return services('router') also could return the type O2System\Kernel\Containers\Services which is incompatible with the documented return type O2System\Framework\Cli\R...m\Framework\Http\Router.
Loading history...
164
    }
165
}
166
167
// ------------------------------------------------------------------------
168
169
if ( ! function_exists('session')) {
170
    /**
171
     * session
172
     *
173
     * Convenient shortcut for O2System Framework Session service.
174
     *
175
     * @return mixed|O2System\Session
176
     */
177
    function session()
178
    {
179
        $args = func_get_args();
180
181
        if (count($args)) {
182
            if(isset($_SESSION[ $args[0] ])) {
183
                return $_SESSION[ $args[0] ];
184
            }
185
186
            return null;
187
        }
188
189
        return services('session');
190
    }
191
}
192
193
// ------------------------------------------------------------------------
194
195
if ( ! function_exists('middleware')) {
196
    /**
197
     * O2System
198
     *
199
     * Convenient shortcut for O2System Framework Http Middleware service.
200
     *
201
     * @return O2System\Framework\Http\Middleware
0 ignored issues
show
Bug introduced by
The type O2System\Framework\Http\Middleware 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...
202
     */
203
    function middleware()
204
    {
205
        return services('middleware');
0 ignored issues
show
Bug Best Practice introduced by
The expression return services('middleware') also could return the type O2System\Kernel\Containers\Services which is incompatible with the documented return type O2System\Framework\Http\Middleware.
Loading history...
206
    }
207
}
208
209
// ------------------------------------------------------------------------
210
211
if ( ! function_exists('controller')) {
212
    /**
213
     * controller
214
     *
215
     * Convenient shortcut for O2System Framework Controller service.
216
     *
217
     * @return O2System\Framework\Http\Controller|bool
0 ignored issues
show
Bug introduced by
The type O2System\Framework\Http\Controller 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...
218
     */
219
    function controller()
220
    {
221
        $args = func_get_args();
222
223
        if (count($args)) {
224
            $controller = services()->get('controller');
225
226
            return call_user_func_array([&$controller, '__call'], $args);
227
        }
228
229
        return services('controller');
0 ignored issues
show
Bug Best Practice introduced by
The expression return services('controller') also could return the type O2System\Kernel\Containers\Services which is incompatible with the documented return type O2System\Framework\Http\Controller|boolean.
Loading history...
230
    }
231
}