Kernel   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 64
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A bootstrap() 0 6 2
A bootstrappers() 0 4 1
A getApplication() 0 4 1
1
<?php
2
3
namespace Magister\Services\Foundation\Http;
4
5
use Magister\Magister;
6
7
/**
8
 * Class Kernel.
9
 */
10
class Kernel
11
{
12
    /**
13
     * The application implementation.
14
     *
15
     * @var \Magister\Magister
16
     */
17
    protected $app;
18
19
    /**
20
     * The bootstrap classes for the application.
21
     *
22
     * @var array
23
     */
24
    protected $bootstrappers = [
25
        'Magister\Services\Foundation\Bootstrap\LoadConfiguration',
26
        'Magister\Services\Foundation\Bootstrap\RegisterSurrogates',
27
        'Magister\Services\Foundation\Bootstrap\RegisterProviders',
28
        'Magister\Services\Foundation\Bootstrap\BootProviders',
29
        'Magister\Services\Foundation\Bootstrap\MakeReplacements',
30
    ];
31
32
    /**
33
     * Create a new kernel instance.
34
     *
35
     * @param \Magister\Magister $app
36
     */
37
    public function __construct(Magister $app)
38
    {
39
        $this->app = $app;
40
    }
41
42
    /**
43
     * Bootstrap the application for http requests.
44
     *
45
     * @return void
46
     */
47
    public function bootstrap()
48
    {
49
        if (!$this->app->hasBeenBootstrapped()) {
50
            $this->app->bootstrapWith($this->bootstrappers());
51
        }
52
    }
53
54
    /**
55
     * Get the bootstrap classes for the application.
56
     *
57
     * @return array
58
     */
59
    protected function bootstrappers()
60
    {
61
        return $this->bootstrappers;
62
    }
63
64
    /**
65
     * Get the Magister application instance.
66
     *
67
     * @return \Magister\Magister
68
     */
69
    public function getApplication()
70
    {
71
        return $this->app;
72
    }
73
}
74