Passed
Push — main ( d103a6...764702 )
by Daniel
11:31
created

ArtUpdateCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 15 1
A execute() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Uxmp\Core\Component\Cli;
6
7
use Ahc\Cli\Input\Command;
8
use Psr\Container\ContainerInterface;
9
use Uxmp\Core\Component\Art\ArtUpdaterInterface;
10
11
final class ArtUpdateCommand extends Command
12
{
13 1
    public function __construct(
14
        private ContainerInterface $dic,
15
    ) {
16 1
        parent::__construct(
17 1
            'art:update',
18 1
            'Update artwork of known items'
19
        );
20
21
        $this
22 1
            ->argument(
23 1
                '<catalogId>',
24 1
                'Id of the catalog'
25
            )
26 1
            ->usage(
27 1
                '<bold>  $0 au 666</end> <comment></end> ## Update the artwork of the catalog with id `666`<eol/>'
28
            );
29 1
    }
30
31 1
    public function execute(?int $catalogId): void
32
    {
33 1
        $this->dic->get(ArtUpdaterInterface::class)->update((int) $catalogId);
34 1
    }
35
}
36