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

PlayerRankingProofUpdateCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 9
dl 0
loc 25
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 4 1
A __construct() 0 6 1
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-proof-update',
17
    description: 'Command to update players ranking'
18
)]
19
class PlayerRankingProofUpdateCommand 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->majRankProof();
39
        return Command::SUCCESS;
40
    }
41
}
42