AuthenticationTokenCreatedEvent.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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\Security\Core\Authentication\Token\TokenInterface;
  12. use Symfony\Contracts\EventDispatcher\Event;
  13. /**
  14. * When a newly authenticated security token was created, before it becomes effective in the security system.
  15. *
  16. * @author Christian Scheb <me@christianscheb.de>
  17. */
  18. class AuthenticationTokenCreatedEvent extends Event
  19. {
  20. private $authenticatedToken;
  21. public function __construct(TokenInterface $token)
  22. {
  23. $this->authenticatedToken = $token;
  24. }
  25. public function getAuthenticatedToken(): TokenInterface
  26. {
  27. return $this->authenticatedToken;
  28. }
  29. public function setAuthenticatedToken(TokenInterface $authenticatedToken): void
  30. {
  31. $this->authenticatedToken = $authenticatedToken;
  32. }
  33. }