Completed
Push — master ( e15c58...b150a8 )
by Changwan
07:08
created

InstallServiceProvider::boot()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 10
ccs 0
cts 9
cp 0
crap 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace Wandu\Installation;
3
4
use Wandu\DI\ContainerInterface;
5
use Wandu\DI\ServiceProviderInterface;
6
use Wandu\Foundation\Contracts\KernelInterface;
7
use Wandu\Installation\Commands\InstallCommand;
8
9
class InstallServiceProvider implements ServiceProviderInterface 
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function register(ContainerInterface $app)
15
    {
16
    }
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function boot(ContainerInterface $app)
22
    {
23
        if ($app->has(KernelInterface::class)) {
24
            /** @var \Wandu\Foundation\Contracts\KernelInterface $kernel */
25
            $kernel = $app->get(KernelInterface::class);
26
            $kernel['commands'] = [
27
                'install' => InstallCommand::class,
28
            ];
29
        }
30
    }
31
}
32