Conditions | 3 |
Paths | 3 |
Total Lines | 22 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3.0327 |
Changes | 12 | ||
Bugs | 0 | Features | 4 |
1 | <?php |
||
17 | 2 | public function boot() : Container |
|
18 | { |
||
19 | 2 | chdir(ROOT); |
|
20 | 2 | umask(0); // todo try to remove |
|
|
|||
21 | |||
22 | 2 | $fileName = ROOT . 'cache/dic.php'; |
|
23 | /** @var Container $dic */ |
||
24 | 2 | if (is_file($fileName)) { |
|
25 | 2 | $className = file_get_contents(ROOT . 'cache/dic.txt'); |
|
26 | 2 | if (!class_exists($className, false)) { |
|
27 | 1 | include $fileName; |
|
28 | } |
||
29 | 2 | $dic = new $className(); |
|
30 | } else { |
||
31 | $rebuild = new Rebuild(); |
||
32 | $dic = $rebuild->rebuildDIC(true); |
||
33 | } |
||
34 | |||
35 | 2 | $dic->get('monolog.ErrorHandler'); |
|
36 | |||
37 | 2 | return $dic; |
|
38 | } |
||
39 | } |
||
40 |