CreateShortUrlData.php 822 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. declare(strict_types=1);
  3. namespace Shlinkio\Shlink\Core\Model;
  4. use Psr\Http\Message\UriInterface;
  5. final class CreateShortUrlData
  6. {
  7. private UriInterface $longUrl;
  8. private array $tags;
  9. private ShortUrlMeta $meta;
  10. public function __construct(
  11. UriInterface $longUrl,
  12. array $tags = [],
  13. ?ShortUrlMeta $meta = null
  14. ) {
  15. $this->longUrl = $longUrl;
  16. $this->tags = $tags;
  17. $this->meta = $meta ?? ShortUrlMeta::createEmpty();
  18. }
  19. /**
  20. */
  21. public function getLongUrl(): UriInterface
  22. {
  23. return $this->longUrl;
  24. }
  25. /**
  26. * @return array
  27. */
  28. public function getTags(): array
  29. {
  30. return $this->tags;
  31. }
  32. /**
  33. */
  34. public function getMeta(): ShortUrlMeta
  35. {
  36. return $this->meta;
  37. }
  38. }