ApplicationBootstrap::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
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 2
dl 0
loc 6
ccs 0
cts 6
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\Bootstrap;
6
7
8
use Laravel\Lumen\Application;
9
use Xervice\Service\Route\RouteProviderInterface;
10
use Xervice\Service\Service\ServiceProviderInterface;
11
12
class ApplicationBootstrap implements ApplicationBootstrapInterface
13
{
14
    /**
15
     * @var \Xervice\Service\Route\RouteProviderInterface
16
     */
17
    private $routeProvider;
18
19
    /**
20
     * @var \Xervice\Service\Service\ServiceProviderInterface
21
     */
22
    private $serviceProvider;
23
24
    /**
25
     * ApplicationBootstrap constructor.
26
     *
27
     * @param \Xervice\Service\Route\RouteProviderInterface $routeProvider
28
     * @param \Xervice\Service\Service\ServiceProviderInterface $serviceProvider
29
     */
30
    public function __construct(
31
        RouteProviderInterface $routeProvider,
32
        ServiceProviderInterface $serviceProvider
33
    ) {
34
        $this->routeProvider = $routeProvider;
35
        $this->serviceProvider = $serviceProvider;
36
    }
37
38
    /**
39
     * @param \Laravel\Lumen\Application $app
40
     */
41
    public function boot(Application $app): void
42
    {
43
        $this->serviceProvider->register($app);
44
        $this->routeProvider->register($app);
45
    }
46
47
}