Replaced UriInterface by string when creating a short URL

This commit is contained in:
Alejandro Celaya
2020-06-24 20:21:05 +02:00
parent a74e1df55c
commit 08950f6433
6 changed files with 18 additions and 37 deletions

View File

@@ -4,41 +4,32 @@ declare(strict_types=1);
namespace Shlinkio\Shlink\Core\Model;
use Psr\Http\Message\UriInterface;
final class CreateShortUrlData
{
private UriInterface $longUrl;
private string $longUrl;
private array $tags;
private ShortUrlMeta $meta;
public function __construct(
UriInterface $longUrl,
array $tags = [],
?ShortUrlMeta $meta = null
) {
public function __construct(string $longUrl, array $tags = [], ?ShortUrlMeta $meta = null)
{
$this->longUrl = $longUrl;
$this->tags = $tags;
$this->meta = $meta ?? ShortUrlMeta::createEmpty();
}
/**
*/
public function getLongUrl(): UriInterface
public function getLongUrl(): string
{
return $this->longUrl;
}
/**
* @return array
* @return string[]
*/
public function getTags(): array
{
return $this->tags;
}
/**
*/
public function getMeta(): ShortUrlMeta
{
return $this->meta;