Passed
Push — develop ( f837ec...edf506 )
by BENARD
06:13
created

PlayerRankingBadgeUpdateCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 7
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VideoGamesRecords\CoreBundle\Command\Ranking;
6
7
use Symfony\Component\Console\Attribute\AsCommand;
8
use Symfony\Component\Console\Command\Command;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Output\OutputInterface;
11
use Symfony\Component\DependencyInjection\Attribute\Autowire;
12
use VideoGamesRecords\CoreBundle\Contracts\Ranking\RankUpdateInterface;
13
use VideoGamesRecords\CoreBundle\Ranking\Command\RankUpdate\PlayerRankUpdateHandler;
14
15
#[AsCommand(
16
    name: 'vgr-core:player-ranking-badge-update',
17
    description: 'Command to update players ranking'
18
)]
19
class PlayerRankingBadgeUpdateCommand extends Command
20
{
21
    private RankUpdateInterface $rankUpdate;
22
23
    public function __construct(
24
        #[Autowire(service: PlayerRankUpdateHandler::class)]
25
        RankUpdateInterface $rankUpdate
26
    ) {
27
        $this->rankUpdate = $rankUpdate;
28
        parent::__construct();
29
    }
30
31
    /**
32
     * @param InputInterface  $input
33
     * @param OutputInterface $output
34
     * @return int
35
     */
36
    protected function execute(InputInterface $input, OutputInterface $output): int
37
    {
38
        $this->rankUpdate->majRankBadge();
39
        return Command::SUCCESS;
40
    }
41
}
42