mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Make sure short URL domain is resolved as null when default one is provided
This commit is contained in:
@@ -31,7 +31,6 @@ class CreateShortUrlCommand extends Command
|
||||
public const NAME = 'short-url:create';
|
||||
|
||||
private ?SymfonyStyle $io;
|
||||
private string $defaultDomain;
|
||||
|
||||
public function __construct(
|
||||
private readonly UrlShortenerInterface $urlShortener,
|
||||
@@ -39,7 +38,6 @@ class CreateShortUrlCommand extends Command
|
||||
private readonly UrlShortenerOptions $options,
|
||||
) {
|
||||
parent::__construct();
|
||||
$this->defaultDomain = $this->options->domain['hostname'] ?? '';
|
||||
}
|
||||
|
||||
protected function configure(): void
|
||||
@@ -121,7 +119,6 @@ class CreateShortUrlCommand extends Command
|
||||
protected function interact(InputInterface $input, OutputInterface $output): void
|
||||
{
|
||||
$this->verifyLongUrlArgument($input, $output);
|
||||
$this->verifyDomainArgument($input);
|
||||
}
|
||||
|
||||
private function verifyLongUrlArgument(InputInterface $input, OutputInterface $output): void
|
||||
@@ -138,12 +135,6 @@ class CreateShortUrlCommand extends Command
|
||||
}
|
||||
}
|
||||
|
||||
private function verifyDomainArgument(InputInterface $input): void
|
||||
{
|
||||
$domain = $input->getOption('domain');
|
||||
$input->setOption('domain', $domain === $this->defaultDomain ? null : $domain);
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): ?int
|
||||
{
|
||||
$io = $this->getIO($input, $output);
|
||||
|
||||
Reference in New Issue
Block a user