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

UpdatePlayerCountryBadgeSubscriber::process()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
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\CountryEvent;
6
use VideoGamesRecords\CoreBundle\Service\Badge\CountryBadgeHandler;
7
use VideoGamesRecords\CoreBundle\VideoGamesRecordsCoreEvents;
8
9
final class UpdatePlayerCountryBadgeSubscriber implements EventSubscriberInterface
10
{
11
    private CountryBadgeHandler $countryBadgeHandler;
12
13
    public function __construct(CountryBadgeHandler $countryBadgeHandler)
14
    {
15
        $this->countryBadgeHandler = $countryBadgeHandler;
16
17
    }
18
19
    public static function getSubscribedEvents(): array
20
    {
21
        return [
22
            VideoGamesRecordsCoreEvents::COUNTRY_MAJ_COMPLETED => 'process',
23
        ];
24
    }
25
26
    /**
27
     * @param CountryEvent $event
28
     */
29
    public function process(CountryEvent $event)
30
    {
31
        $this->countryBadgeHandler->process($event->getCountry());
32
    }
33
}
34