LogoutEvent.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  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 Symfony\Component\Security\Http\Event;
  11. use Symfony\Component\HttpFoundation\Request;
  12. use Symfony\Component\HttpFoundation\Response;
  13. use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
  14. use Symfony\Contracts\EventDispatcher\Event;
  15. /**
  16. * @author Wouter de Jong <wouter@wouterj.nl>
  17. */
  18. class LogoutEvent extends Event
  19. {
  20. private $request;
  21. private $response;
  22. private $token;
  23. public function __construct(Request $request, ?TokenInterface $token)
  24. {
  25. $this->request = $request;
  26. $this->token = $token;
  27. }
  28. public function getRequest(): Request
  29. {
  30. return $this->request;
  31. }
  32. public function getToken(): ?TokenInterface
  33. {
  34. return $this->token;
  35. }
  36. public function setResponse(Response $response): void
  37. {
  38. $this->response = $response;
  39. }
  40. public function getResponse(): ?Response
  41. {
  42. return $this->response;
  43. }
  44. }