Completed
Push — master ( 52fc21...54ccda )
by Changwan
04:36 queued 01:37
created

ConsoleBootstrap::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
namespace Wandu\Foundation\Bootstrap;
3
4
use Symfony\Component\Console\Application as SymfonyApplication;
5
use Wandu\Config\ConfigServiceProvider;
6
use Wandu\Console\ConsoleServiceProvider;
7
use Wandu\Console\Dispatcher;
8
use Wandu\DI\ContainerInterface;
9
use Wandu\Foundation\Contracts\Bootstrap;
10
11
class ConsoleBootstrap implements Bootstrap
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function providers(): array
17
    {
18
        return [
19
            new ConfigServiceProvider(),
20
            new ConsoleServiceProvider(),
21
        ];
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function boot(ContainerInterface $app)
28
    {
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function execute(ContainerInterface $app): int
35
    {
36
        $app->get(Dispatcher::class)->execute();
37
        return $app->get(SymfonyApplication::class)->run();
38
    }
39
}
40