Application::make()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 6
1
<?php
2
namespace DevOp\Core\Framework;
3
4
use DevOp\Core\Container;
5
use DevOp\Core\Framework\Controller;
6
7
class Application
8
{
9
10
    /**
11
     * @var Container
12
     */
13
    private $container;
14
15
    /**
16
     * @return $this
17
     */
18
    private static $instance;
19
20
    /**
21
     * @return $this
22
     */
23
    public static function make()
24
    {
25
        if (null === self::$instance) {
26
            self::$instance = new Application();
27
        }
28
        return self::$instance;
29
    }
30
31
    /**
32
     * 
33
     * @return $this
34
     */
35
    public function configure()
36
    {
37
        $this->container = new Container();
38
39
        $this->container->add('debug', env('APP_DEBUG'));
40
41
        $this->container->add(Controller::class, function() {
42
            return new Controller($this->container);
43
        });
44
45
        return $this;
46
    }
47
48
    public function process()
49
    {
50
51
        return $this;
52
    }
53
54
    public function end()
55
    {
56
        return $this;
57
    }
58
}
59