mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-14 04:00:57 +03:00
Removed CLI language param from installation
This commit is contained in:
parent
d4d65bdf37
commit
64737b741b
3 changed files with 3 additions and 18 deletions
|
@ -11,10 +11,8 @@ use function array_keys;
|
|||
class LanguageConfigCustomizer implements ConfigCustomizerInterface
|
||||
{
|
||||
public const DEFAULT_LANG = 'DEFAULT';
|
||||
public const CLI_LANG = 'CLI';
|
||||
private const EXPECTED_KEYS = [
|
||||
self::DEFAULT_LANG,
|
||||
self::CLI_LANG,
|
||||
];
|
||||
|
||||
private const SUPPORTED_LANGUAGES = ['en', 'es'];
|
||||
|
@ -41,9 +39,7 @@ class LanguageConfigCustomizer implements ConfigCustomizerInterface
|
|||
{
|
||||
switch ($key) {
|
||||
case self::DEFAULT_LANG:
|
||||
return $this->chooseLanguage($io, 'Select default language for the application in general');
|
||||
case self::CLI_LANG:
|
||||
return $this->chooseLanguage($io, 'Select default language for CLI executions');
|
||||
return $this->chooseLanguage($io, 'Select default language for the application error pages');
|
||||
}
|
||||
|
||||
return '';
|
||||
|
|
|
@ -138,7 +138,6 @@ final class CustomizableAppConfig implements ArraySerializableInterface
|
|||
|
||||
$this->setLanguage($this->mapExistingPathsToKeys([
|
||||
LanguageConfigCustomizer::DEFAULT_LANG => ['translator', 'locale'],
|
||||
LanguageConfigCustomizer::CLI_LANG => ['cli', 'locale'],
|
||||
], $pathCollection));
|
||||
|
||||
$this->setUrlShortener($this->mapExistingPathsToKeys([
|
||||
|
@ -191,9 +190,6 @@ final class CustomizableAppConfig implements ArraySerializableInterface
|
|||
'translator' => [
|
||||
'locale' => $this->language[LanguageConfigCustomizer::DEFAULT_LANG] ?? 'en',
|
||||
],
|
||||
'cli' => [
|
||||
'locale' => $this->language[LanguageConfigCustomizer::CLI_LANG] ?? 'en',
|
||||
],
|
||||
'url_shortener' => [
|
||||
'domain' => [
|
||||
'schema' => $this->urlShortener[UrlShortenerConfigCustomizer::SCHEMA] ?? 'http',
|
||||
|
|
|
@ -41,9 +41,8 @@ class LanguageConfigCustomizerTest extends TestCase
|
|||
$this->assertTrue($config->hasLanguage());
|
||||
$this->assertEquals([
|
||||
'DEFAULT' => 'en',
|
||||
'CLI' => 'en',
|
||||
], $config->getLanguage());
|
||||
$choice->shouldHaveBeenCalledTimes(2);
|
||||
$choice->shouldHaveBeenCalledOnce();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -53,15 +52,11 @@ class LanguageConfigCustomizerTest extends TestCase
|
|||
{
|
||||
$choice = $this->io->choice(Argument::cetera())->willReturn('es');
|
||||
$config = new CustomizableAppConfig();
|
||||
$config->setLanguage([
|
||||
'DEFAULT' => 'en',
|
||||
]);
|
||||
|
||||
$this->plugin->process($this->io->reveal(), $config);
|
||||
|
||||
$this->assertEquals([
|
||||
'DEFAULT' => 'en',
|
||||
'CLI' => 'es',
|
||||
'DEFAULT' => 'es',
|
||||
], $config->getLanguage());
|
||||
$choice->shouldHaveBeenCalledOnce();
|
||||
}
|
||||
|
@ -76,14 +71,12 @@ class LanguageConfigCustomizerTest extends TestCase
|
|||
$config = new CustomizableAppConfig();
|
||||
$config->setLanguage([
|
||||
'DEFAULT' => 'es',
|
||||
'CLI' => 'es',
|
||||
]);
|
||||
|
||||
$this->plugin->process($this->io->reveal(), $config);
|
||||
|
||||
$this->assertEquals([
|
||||
'DEFAULT' => 'es',
|
||||
'CLI' => 'es',
|
||||
], $config->getLanguage());
|
||||
$choice->shouldNotHaveBeenCalled();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue