Completed
Push — master ( c458f8...eeebc2 )
by Matze
06:56
created

Core   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 85.71%

Importance

Changes 17
Bugs 0 Features 7
Metric Value
wmc 3
c 17
b 0
f 7
lcom 0
cbo 1
dl 0
loc 29
ccs 12
cts 14
cp 0.8571
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 22 3
1
<?php
2
3
namespace BrainExe\Core;
4
5
use BrainExe\Core\DependencyInjection\Rebuild;
6
use Symfony\Component\DependencyInjection\Container;
7
8
/**
9
 * @api
10
 */
11
class Core
12
{
13
14
    /**
15
     * @return Container
16
     */
17 2
    public function boot() : Container
18
    {
19 2
        chdir(ROOT);
20 2
        umask(0); // todo try to remove
0 ignored issues
show
Coding Style Best Practice introduced by
Comments for TODO tasks are often forgotten in the code; it might be better to use a dedicated issue tracker.
Loading history...
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