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

GameOfDayAddCommand::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
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
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