ApplicationBootstrap   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 33
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A __construct() 0 6 1
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
}