src/Core/EventSubscriber/CreateCompetitionRankingSubscriber.php line 27

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Core\EventSubscriber;
  4. use App\Core\Event\CreateCompetitionRankingEvent;
  5. use App\Core\Service\FastProcessor\CompetitionRankingProcessor;
  6. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  7. class CreateCompetitionRankingSubscriber implements EventSubscriberInterface
  8. {
  9.     private CompetitionRankingProcessor $competitionRankingProcessor;
  10.     public function __construct(CompetitionRankingProcessor $competitionRankingProcessor)
  11.     {
  12.         $this->competitionRankingProcessor $competitionRankingProcessor;
  13.     }
  14.     public static function getSubscribedEvents(): array
  15.     {
  16.         return [
  17.             CreateCompetitionRankingEvent::class => 'createCompetitionRanking',
  18.         ];
  19.     }
  20.     public function createCompetitionRanking(CreateCompetitionRankingEvent $event)
  21.     {
  22.         $this->competitionRankingProcessor->create($event->getTournament(), $event->getData());
  23.     }
  24. }