Passed
Push — master ( 784be2...c4713a )
by Nico
58:15 queued 29:26
created

WarpdriveSplitRefactorCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
dl 0
loc 28
ccs 0
cts 16
cp 0
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 8 1
A __construct() 0 13 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Component\Cli;
6
7
use Ahc\Cli\Input\Command;
8
use Psr\Container\ContainerInterface;
9
use Stu\Component\Ship\Refactor\RefactorWarpdriveSplitRunner;
10
11
final class WarpdriveSplitRefactorCommand extends Command
12
{
13
    private ContainerInterface $dic;
14
15
    public function __construct(
16
        ContainerInterface $dic
17
    ) {
18
        $this->dic = $dic;
19
20
        parent::__construct(
21
            'refactor:split',
22
            'Moves the warpdrive split from core to drive'
23
        );
24
25
        $this
26
            ->usage(
27
                '<bold>  $0 refactor:split</end> <comment></end> ## Refactors warpdrive split<eol/>'
28
            );
29
    }
30
31
    public function execute(): void
32
    {
33
        $runner = $this->dic->get(RefactorWarpdriveSplitRunner::class);
34
        $runner->refactor();
35
36
        $this->io()->ok(
37
            'Warpdrive split has been refactored',
38
            true
39
        );
40
    }
41
}
42