Passed
Push — master ( 9eac7c...67926c )
by Vladimir
03:08
created

Factory::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 12
nc 1
nop 1
dl 0
loc 18
ccs 13
cts 13
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Toolbelt;
6
7
use FondBot\Application\Kernel;
8
use League\Container\Container;
9
use Symfony\Component\Console\Application;
10
11
class Factory
12
{
13 1
    public static function create(Container $container): void
14
    {
15 1
        $kernel = $container->get(Kernel::class);
16
17
        // Boot console application
18 1
        $console = new Application('FondBot', Kernel::VERSION);
19 1
        $console->addCommands([
20 1
            new Commands\MakeIntent($kernel),
21 1
            new Commands\MakeInteraction($kernel),
22 1
            new Commands\ListDrivers($kernel),
23 1
            new Commands\InstallDriver($kernel),
24 1
            new Commands\ListChannels($kernel),
25 1
            new Commands\Log($kernel),
26 1
            new Commands\QueueWorker($kernel),
27
        ]);
28
29 1
        $container->add('console', $console);
30 1
    }
31
}
32