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

GameOfDayAddCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 9
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A execute() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VideoGamesRecords\CoreBundle\Command;
6
7
use 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\Manager\GameOfDayManager;
13
14
#[AsCommand(
15
    name: 'vgr-core:game-of-day-add',
16
    description: 'Command to add game of day'
17
)]
18
class GameOfDayAddCommand extends Command
19
{
20
    private GameOfDayManager $gameOfDayManager;
21
22
    public function __construct(GameOfDayManager $gameOfDayManager)
23
    {
24
        $this->gameOfDayManager = $gameOfDayManager;
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->gameOfDayManager->addTomorrowGame();
37
        return Command::SUCCESS;
38
    }
39
}
40