Application::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
5
namespace Xervice\Service\Application;
6
7
8
use Laravel\Lumen\Application as LumenApplication;
9
use Xervice\Service\Bootstrap\ApplicationBootstrapInterface;
10
11
class Application
12
{
13
    /**
14
     * @var \Laravel\Lumen\Application
15
     */
16
    private $app;
17
18
    /**
19
     * @var \Xervice\Service\Bootstrap\ApplicationBootstrapInterface
20
     */
21
    private $bootstrap;
22
23
    /**
24
     * Application constructor.
25
     *
26
     * @param \Laravel\Lumen\Application $app
27
     * @param \Xervice\Service\Bootstrap\ApplicationBootstrapInterface $bootstrap
28
     */
29
    public function __construct(
30
        LumenApplication $app,
31
        ApplicationBootstrapInterface $bootstrap
32
    ) {
33
        $this->app = $app;
34
        $this->bootstrap = $bootstrap;
35
    }
36
37
    /**
38
     * @return \Xervice\Service\Application\Application
39
     */
40
    public function boot() : Application
41
    {
42
        $this->bootstrap->boot($this->app);
43
44
        return $this;
45
    }
46
47
    public function run() : void
48
    {
49
        $this->app->run();
50
    }
51
}