ScoreInvestigationUpdate::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VideoGamesRecords\CoreBundle\Command;
6
7
use Doctrine\ORM\Exception\ORMException;
8
use Doctrine\ORM\OptimisticLockException;
9
use Symfony\Component\Console\Attribute\AsCommand;
10
use Symfony\Component\Console\Command\Command;
11
use Symfony\Component\Console\Input\InputInterface;
12
use Symfony\Component\Console\Output\OutputInterface;
13
use VideoGamesRecords\CoreBundle\Handler\ScoreInvestigationHandler;
14
15
#[AsCommand(
16
    name: 'vgr-core:score-investigation-update',
17
    description: 'Command to check score under investigation'
18
)]
19
class ScoreInvestigationUpdate extends Command
20
{
21
    private ScoreInvestigationHandler $scoreInvestigationHandler;
22
23
    public function __construct(ScoreInvestigationHandler $scoreInvestigationHandler)
24
    {
25
        $this->scoreInvestigationHandler = $scoreInvestigationHandler;
26
        parent::__construct();
27
    }
28
29
30
    /**
31
     * @param InputInterface  $input
32
     * @param OutputInterface $output
33
     * @return int
34
     * @throws OptimisticLockException|ORMException
35
     */
36
    protected function execute(InputInterface $input, OutputInterface $output): int
37
    {
38
        $this->scoreInvestigationHandler->handle();
39
        return Command::SUCCESS;
40
    }
41
}
42