LoginLinkDetails.php 846 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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\LoginLink;
  11. /**
  12. * @author Ryan Weaver <ryan@symfonycasts.com>
  13. * @experimental in 5.2
  14. */
  15. class LoginLinkDetails
  16. {
  17. private $url;
  18. private $expiresAt;
  19. public function __construct(string $url, \DateTimeImmutable $expiresAt)
  20. {
  21. $this->url = $url;
  22. $this->expiresAt = $expiresAt;
  23. }
  24. public function getUrl(): string
  25. {
  26. return $this->url;
  27. }
  28. public function getExpiresAt(): \DateTimeImmutable
  29. {
  30. return $this->expiresAt;
  31. }
  32. public function __toString()
  33. {
  34. return $this->url;
  35. }
  36. }