Passed
Push — develop ( 0ad6ef...06118e )
by BENARD
12:32
created

UpdatePlayerSerieBadgeSubscriber::process()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
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\SerieEvent;
6
use VideoGamesRecords\CoreBundle\Handler\Badge\PlayerSerieBadgeHandler;
7
use VideoGamesRecords\CoreBundle\VideoGamesRecordsCoreEvents;
8
9
final class UpdatePlayerSerieBadgeSubscriber implements EventSubscriberInterface
10
{
11
    private PlayerSerieBadgeHandler $badgeHandler;
12
13
    public function __construct(PlayerSerieBadgeHandler $badgeHandler)
14
    {
15
        $this->badgeHandler = $badgeHandler;
16
    }
17
18
    public static function getSubscribedEvents(): array
19
    {
20
        return [
21
            VideoGamesRecordsCoreEvents::SERIE_MAJ_COMPLETED => 'process',
22
        ];
23
    }
24
25
    /**
26
     * @param SerieEvent $event
27
     */
28
    public function process(SerieEvent $event)
29
    {
30
        echo 'tutu';
31
        $this->badgeHandler->process($event->getSerie());
32
    }
33
}
34