PurgeLostPositionHandler::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 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\PurgeLostPosition;
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 PurgeLostPosition $message
21
     * @return void
22
     * @throws Exception
23
     */
24
    public function __invoke(PurgeLostPosition $message): void
25
    {
26
        $this->manager->purge();
27
    }
28
}
29