Passed
Pull Request — develop (#97)
by BENARD
12:42
created

PurgeLostPositionHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A __invoke() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VideoGamesRecords\CoreBundle\Scheduler\Handler;
6
7
use Doctrine\DBAL\Exception;
8
use VideoGamesRecords\CoreBundle\Manager\LostPositionManager;
9
use VideoGamesRecords\CoreBundle\Scheduler\Message\DesactivateScore;
10
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
11
12
#[AsMessageHandler]
13
class PurgeLostPositionHandler
14
{
15
    public function __construct(private readonly LostPositionManager $manager)
16
    {
17
    }
18
19
    /**
20
     * @param DesactivateScore $message
21
     * @return void
22
     * @throws Exception
23
     */
24
    public function __invoke(DesactivateScore $message): void
25
    {
26
        $this->manager->purge();
27
    }
28
}
29