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

ColonyCorrectionCommand::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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