Core::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2.0438

Importance

Changes 0
Metric Value
dl 0
loc 17
ccs 7
cts 9
cp 0.7778
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 9
nc 2
nop 0
crap 2.0438
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 1
    public function boot() : Container
18
    {
19 1
        $fileName = ROOT . 'cache/dic.php';
20
        /** @var Container $dic */
21 1
        if (!is_file($fileName)) {
22
            $rebuild = new Rebuild();
23
            $rebuild->buildContainer();
24
        }
25
26 1
        include_once $fileName;
27
28 1
        $dic = new \DumpedContainer();
29
30 1
        $dic->get('monolog.ErrorHandler');
31
32 1
        return $dic;
33
    }
34
}
35