Passed
Push — develop ( a1dd18...3f55cc )
by BENARD
04:37
created

GameSubscriber::teamGamePostMaj()   A

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
namespace VideoGamesRecords\CoreBundle\EventSubscriber;
3
4
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
5
use VideoGamesRecords\CoreBundle\Event\GameEvent;
6
use VideoGamesRecords\CoreBundle\Manager\GameManager;
7
use VideoGamesRecords\CoreBundle\Service\Badge\PlayerMasterBadgeHandler;
8
use VideoGamesRecords\CoreBundle\Service\Badge\TeamMasterBadgeHandler;
9
use VideoGamesRecords\CoreBundle\VideoGamesRecordsCoreEvents;
10
11
final class GameSubscriber implements EventSubscriberInterface
12
{
13
    private GameManager $gameManager;
14
15
    public function __construct(GameManager $gameManager) {
16
        $this->gameManager = $gameManager;
17
    }
18
19
    public static function getSubscribedEvents(): array
20
    {
21
        return [
22
            VideoGamesRecordsCoreEvents::SCORE_PLATFORM_UPDATED => 'majGame',
23
        ];
24
    }
25
26
27
    /**
28
     * @param GameEvent $event
29
     */
30
    public function majGame(GameEvent $event): void
31
    {
32
        $this->gameManager->maj($event->getGame());
33
    }
34
}
35