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

ConsoleBootstrap   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 29
ccs 0
cts 15
cp 0
rs 10
wmc 3
lcom 0
cbo 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A providers() 0 7 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\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