mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 09:43:13 +08:00
Normalized some filtering
This commit is contained in:
@@ -40,6 +40,10 @@ class ShortUrl extends AbstractEntity
|
||||
private ?string $importOriginalShortCode = null;
|
||||
private ?ApiKey $authorApiKey = null;
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public static function createEmpty(): self
|
||||
{
|
||||
return self::fromMeta(ShortUrlMeta::createEmpty());
|
||||
@@ -219,9 +223,10 @@ class ShortUrl extends AbstractEntity
|
||||
|
||||
public function toString(array $domainConfig): string
|
||||
{
|
||||
return (string) (new Uri())->withPath($this->shortCode)
|
||||
->withScheme($domainConfig['schema'] ?? 'http')
|
||||
->withHost($this->resolveDomain($domainConfig['hostname'] ?? ''));
|
||||
return (new Uri())->withPath($this->shortCode)
|
||||
->withScheme($domainConfig['schema'] ?? 'http')
|
||||
->withHost($this->resolveDomain($domainConfig['hostname'] ?? ''))
|
||||
->__toString();
|
||||
}
|
||||
|
||||
private function resolveDomain(string $fallback = ''): string
|
||||
|
||||
Reference in New Issue
Block a user