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

LostPositionPurgeCommand::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 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\Manager\LostPositionManager;
13
use VideoGamesRecords\CoreBundle\Repository\LostPositionRepository;
14
15
#[AsCommand(
16
    name: 'vgr-core:lost-position-purge',
17
    description: 'Command to purge lost positions'
18
)]
19
class LostPositionPurgeCommand extends Command
20
{
21
    private LostPositionManager $lostPositionManager;
22
23
    public function __construct(LostPositionManager $lostPositionManager)
24
    {
25
        $this->lostPositionManager = $lostPositionManager;
26
        parent::__construct();
27
    }
28
29
    /**
30
     * @param InputInterface  $input
31
     * @param OutputInterface $output
32
     * @return int
33
     * @throws Exception
34
     */
35
    protected function execute(InputInterface $input, OutputInterface $output): int
36
    {
37
        $this->lostPositionManager->purge();
38
        return Command::SUCCESS;
39
    }
40
}
41