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

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