Passed
Pull Request — master (#2073)
by Janko
27:01 queued 14:19
created

ColonyCorrectionCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 21
ccs 12
cts 12
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 5 1
A __construct() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Component\Cli;
6
7
use Ahc\Cli\Input\Command;
8
use Stu\Module\Colony\Lib\ColonyCorrectorInterface;
9
10
/**
11
 * Provides cli method for colony correction
12
 */
13
final class ColonyCorrectionCommand extends Command
14
{
15 1
    public function __construct(
16
        private readonly ColonyCorrectorInterface $colonyCorrector,
17
    ) {
18 1
        parent::__construct(
19 1
            'colony:correct',
20 1
            'Corrects colonies'
21 1
        );
22
23 1
        $this
24 1
            ->usage(
25 1
                '<bold>  $0 colony:correct</end> <comment></end> ## Corrects colonies<eol/>'
26 1
            );
27
    }
28
29 1
    public function execute(): void
30
    {
31 1
        $this->colonyCorrector->correct();
32
33 1
        $this->io()->ok('Korrektur der Kolonien wurde durchgeführt.', true);
34
    }
35
}
36