TokenProviderInterface.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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\Core\Authentication\RememberMe;
  11. use Symfony\Component\Security\Core\Exception\TokenNotFoundException;
  12. /**
  13. * Interface for TokenProviders.
  14. *
  15. * @author Johannes M. Schmitt <schmittjoh@gmail.com>
  16. */
  17. interface TokenProviderInterface
  18. {
  19. /**
  20. * Loads the active token for the given series.
  21. *
  22. * @return PersistentTokenInterface
  23. *
  24. * @throws TokenNotFoundException if the token is not found
  25. */
  26. public function loadTokenBySeries(string $series);
  27. /**
  28. * Deletes all tokens belonging to series.
  29. */
  30. public function deleteTokenBySeries(string $series);
  31. /**
  32. * Updates the token according to this data.
  33. *
  34. * @throws TokenNotFoundException if the token is not found
  35. */
  36. public function updateToken(string $series, string $tokenValue, \DateTime $lastUsed);
  37. /**
  38. * Creates a new token.
  39. */
  40. public function createNewToken(PersistentTokenInterface $token);
  41. }