Completed
Push — master ( 238323...52fc21 )
by Changwan
03:17
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\Console\Dispatcher;
6
use Wandu\DI\ContainerInterface;
7
use Wandu\Foundation\Contracts\Bootstrap;
8
9
class ConsoleBootstrap implements Bootstrap
10
{
11
    /** @var array */
12
    protected $commands;
13
14
    public function __construct(array $commands = [])
15
    {
16
        $this->commands = $commands;
17
    }
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function providers(): array
23
    {
24
        return [];
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function boot(ContainerInterface $app)
31
    {
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function execute(ContainerInterface $app): int
38
    {
39
        $app->get(Dispatcher::class)->execute();
40
        return $app->get(SymfonyApplication::class)->run();
41
    }
42
}
43