Completed
Push — master ( 238323...52fc21 )
by Changwan
03:17
created

ConsoleBootstrap   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 34
ccs 0
cts 16
cp 0
rs 10
wmc 4
lcom 0
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A providers() 0 4 1
A boot() 0 3 1
A execute() 0 5 1
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