Passed
Pull Request — master (#1685)
by Nico
30:06
created

WarpdriveSplitRefactorCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
nc 1
nop 1
dl 0
loc 13
ccs 0
cts 9
cp 0
crap 2
rs 10
c 1
b 0
f 0
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