Passed
Push — develop ( 04f018...e920eb )
by BENARD
04:15
created

PlayerBadgeUpdateCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
namespace VideoGamesRecords\CoreBundle\Command;
3
4
use Doctrine\DBAL\Exception;
5
use Symfony\Component\Console\Command\Command;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
use VideoGamesRecords\CoreBundle\Handler\Badge\PlayerBadgeHandler;
9
10
class PlayerBadgeUpdateCommand extends Command
11
{
12
    protected static $defaultName = 'vgr-core:player-badge-update';
13
14
    private PlayerBadgeHandler $playerBadgeHandler;
15
16
    public function __construct(PlayerBadgeHandler $playerBadgeHandler)
17
    {
18
        $this->playerBadgeHandler = $playerBadgeHandler;
19
        parent::__construct();
20
    }
21
22
    protected function configure(): void
23
    {
24
        $this
25
            ->setName('vgr-core:player-badge-update')
26
            ->setDescription('Command to maj player badges')
27
        ;
28
        parent::configure();
29
    }
30
31
    /**
32
     * @param InputInterface  $input
33
     * @param OutputInterface $output
34
     * @return int
35
     * @throws Exception
36
     */
37
    protected function execute(InputInterface $input, OutputInterface $output): int
38
    {
39
        $this->playerBadgeHandler->process();
40
        return Command::SUCCESS;
41
    }
42
}
43