src/EventSubscriber/Exercise/LoginSubscriber.php line 54

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of the adrec-platform package.
  4. *
  5. * (c) Benjamin Georgeault <https://www.pressop.eu>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace App\EventSubscriber\Exercise;
  11. use Doctrine\ORM\EntityManagerInterface;
  12. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  13. use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
  14. use Symfony\Component\Security\Http\SecurityEvents;
  15. /**
  16. * Class LoginSubscriber
  17. *
  18. * @author Benjamin Georgeault
  19. */
  20. class LoginSubscriber implements EventSubscriberInterface
  21. {
  22. /**
  23. * @var EntityManagerInterface
  24. */
  25. private $em;
  26. /**
  27. * LoginSubscriber constructor.
  28. *
  29. * @param EntityManagerInterface $em
  30. */
  31. public function __construct(EntityManagerInterface $em)
  32. {
  33. $this->em = $em;
  34. }
  35. /**
  36. * @return string[]
  37. */
  38. public static function getSubscribedEvents(): array
  39. {
  40. return [
  41. SecurityEvents::INTERACTIVE_LOGIN => 'checkPendingExercise',
  42. ];
  43. }
  44. /**
  45. * @param InteractiveLoginEvent $event
  46. */
  47. public function checkPendingExercise(InteractiveLoginEvent $event)
  48. {
  49. }
  50. }