These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | namespace humanity; |
||
3 | |||
4 | class Application { |
||
5 | |||
6 | private static $memory = []; |
||
0 ignored issues
–
show
|
|||
7 | private static $config; |
||
8 | private static $application = []; |
||
9 | |||
10 | public function __construct(){ |
||
11 | self::$config = (new Config)->get(); |
||
12 | } |
||
13 | |||
14 | public function __get($name){ |
||
15 | array_push(self::$application,$name); |
||
16 | return (new self); |
||
17 | } |
||
18 | |||
19 | public function __call($name,$value){ |
||
20 | array_push(self::$application,$name); |
||
21 | $file = implode('/',self::$application); |
||
22 | $file = self::$config['core']['apps'].'/'.$file.'.php'; |
||
23 | self::$application = []; |
||
24 | if(is_file($file)) { |
||
25 | $result = require($file); |
||
26 | if(is_callable($result)) $result = call_user_func_array($result,$value); |
||
27 | return $result; |
||
28 | } |
||
29 | } |
||
30 | |||
31 | } |
||
32 | ?> |
||
0 ignored issues
–
show
It is not recommended to use PHP's closing tag
?> in files other than templates.
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore. A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever. ![]() |
|||
33 |
This check marks private properties in classes that are never used. Those properties can be removed.