Passed
Push — develop ( f837ec...edf506 )
by BENARD
06:13
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
3
declare(strict_types=1);
4
5
namespace VideoGamesRecords\CoreBundle\Command;
6
7
use Doctrine\DBAL\Exception;
8
use Symfony\Component\Console\Attribute\AsCommand;
9
use Symfony\Component\Console\Command\Command;
10
use Symfony\Component\Console\Input\InputInterface;
11
use Symfony\Component\Console\Output\OutputInterface;
12
use VideoGamesRecords\CoreBundle\Handler\Badge\PlayerBadgeHandler;
13
14
#[AsCommand(
15
    name: 'vgr-core:player-badge-update',
16
    description: 'Command to maj player badges'
17
)]
18
class PlayerBadgeUpdateCommand extends Command
19
{
20
    private PlayerBadgeHandler $playerBadgeHandler;
21
22
    public function __construct(PlayerBadgeHandler $playerBadgeHandler)
23
    {
24
        $this->playerBadgeHandler = $playerBadgeHandler;
25
        parent::__construct();
26
    }
27
28
    /**
29
     * @param InputInterface  $input
30
     * @param OutputInterface $output
31
     * @return int
32
     * @throws Exception
33
     */
34
    protected function execute(InputInterface $input, OutputInterface $output): int
35
    {
36
        $this->playerBadgeHandler->handle();
37
        return Command::SUCCESS;
38
    }
39
}
40