mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 09:43:13 +08:00
Simplify NotFoundRedirectConfigInterface with property hooks and asymetric visibility
This commit is contained in:
@@ -88,15 +88,15 @@ class DomainRedirectsCommand extends Command
|
||||
$this->domainService->configureNotFoundRedirects($domainAuthority, NotFoundRedirects::withRedirects(
|
||||
$ask(
|
||||
'URL to redirect to when a user hits this domain\'s base URL',
|
||||
$domain?->baseUrlRedirect(),
|
||||
$domain?->baseUrlRedirect,
|
||||
),
|
||||
$ask(
|
||||
'URL to redirect to when a user hits a not found URL other than an invalid short URL',
|
||||
$domain?->regular404Redirect(),
|
||||
$domain?->regular404Redirect,
|
||||
),
|
||||
$ask(
|
||||
'URL to redirect to when a user hits an invalid short URL',
|
||||
$domain?->invalidShortUrlRedirect(),
|
||||
$domain?->invalidShortUrlRedirect,
|
||||
),
|
||||
));
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ class ListDomainsCommand extends Command
|
||||
|
||||
private function notFoundRedirectsToString(NotFoundRedirectConfigInterface $config): string
|
||||
{
|
||||
$baseUrl = $config->baseUrlRedirect() ?? 'N/A';
|
||||
$regular404 = $config->regular404Redirect() ?? 'N/A';
|
||||
$invalidShortUrl = $config->invalidShortUrlRedirect() ?? 'N/A';
|
||||
$baseUrl = $config->baseUrlRedirect ?? 'N/A';
|
||||
$regular404 = $config->regular404Redirect ?? 'N/A';
|
||||
$invalidShortUrl = $config->invalidShortUrlRedirect ?? 'N/A';
|
||||
|
||||
return <<<EOL
|
||||
* Base URL: {$baseUrl}
|
||||
|
||||
Reference in New Issue
Block a user