Passed
Pull Request — master (#1686)
by Nico
31:24
created

ReactorRefactorCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
A execute() 0 8 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\RefactorReactorRunner;
10
11
final class ReactorRefactorCommand 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:reactor',
22
            'Moves reactor values from ship to system data'
23
        );
24
25
        $this
26
            ->usage(
27
                '<bold>  $0 refactor:reactor</end> <comment></end> ## Refactors reactor values<eol/>'
28
            );
29
    }
30
31
    public function execute(): void
32
    {
33
        $runner = $this->dic->get(RefactorReactorRunner::class);
34
        $runner->refactor();
35
36
        $this->io()->ok(
37
            'Reactor values have been refactored',
38
            true
39
        );
40
    }
41
}
42