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

AddGameOfDayHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
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 10
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 VideoGamesRecords\CoreBundle\Manager\GameOfDayManager;
8
use VideoGamesRecords\CoreBundle\Scheduler\Message\UpdatePlayerChartRanking;
9
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
10
11
#[AsMessageHandler]
12
class AddGameOfDayHandler
13
{
14
    public function __construct(private readonly GameOfDayManager $manager)
15
    {
16
    }
17
18
    public function __invoke(UpdatePlayerChartRanking $message): void
19
    {
20
        $this->manager->addTomorrowGame();
21
    }
22
}
23