Conditions | 4 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
21 | static function instance ($check = false) { |
||
22 | static $instance; |
||
23 | $class = get_called_class(); |
||
24 | $request_specific_classes = [ |
||
25 | 'cs\\Event', |
||
26 | 'cs\\Index', |
||
27 | 'cs\\Menu', |
||
28 | 'cs\\Page', |
||
29 | 'cs\\Page\\Meta', |
||
30 | 'cs\\Route', |
||
31 | 'cs\\Session' |
||
32 | ]; |
||
33 | if (in_array($class, $request_specific_classes)) { |
||
34 | $objects_pool = &objects_pool(); |
||
35 | if (isset($objects_pool[$class]) && $objects_pool[$class]) { |
||
36 | return $objects_pool[$class]; |
||
37 | } |
||
38 | return self::instance_prototype($objects_pool[$class], $check); |
||
39 | } |
||
40 | return self::instance_prototype($instance, $check); |
||
41 | } |
||
42 | } |
||
43 |