mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 17:23:12 +08:00
Updated ConfigCustomizer api to expect a SymfonyStyle object instead of a set of input and output
This commit is contained in:
@@ -5,8 +5,6 @@ namespace Shlinkio\Shlink\CLI\Install\Plugin;
|
||||
|
||||
use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Shlinkio\Shlink\Common\Util\StringUtilsTrait;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
class ApplicationConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
|
||||
@@ -14,14 +12,12 @@ class ApplicationConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
|
||||
use StringUtilsTrait;
|
||||
|
||||
/**
|
||||
* @param InputInterface $input
|
||||
* @param OutputInterface $output
|
||||
* @param SymfonyStyle $io
|
||||
* @param CustomizableAppConfig $appConfig
|
||||
* @return void
|
||||
*/
|
||||
public function process(InputInterface $input, OutputInterface $output, CustomizableAppConfig $appConfig)
|
||||
public function process(SymfonyStyle $io, CustomizableAppConfig $appConfig)
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
$io->title('APPLICATION');
|
||||
|
||||
if ($appConfig->hasApp() && $io->confirm('Do you want to keep imported application config?')) {
|
||||
|
||||
@@ -4,16 +4,14 @@ declare(strict_types=1);
|
||||
namespace Shlinkio\Shlink\CLI\Install\Plugin;
|
||||
|
||||
use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
interface ConfigCustomizerPluginInterface
|
||||
{
|
||||
/**
|
||||
* @param InputInterface $input
|
||||
* @param OutputInterface $output
|
||||
* @param SymfonyStyle $io
|
||||
* @param CustomizableAppConfig $appConfig
|
||||
* @return void
|
||||
*/
|
||||
public function process(InputInterface $input, OutputInterface $output, CustomizableAppConfig $appConfig);
|
||||
public function process(SymfonyStyle $io, CustomizableAppConfig $appConfig);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@ declare(strict_types=1);
|
||||
namespace Shlinkio\Shlink\CLI\Install\Plugin;
|
||||
|
||||
use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Symfony\Component\Filesystem\Exception\IOException;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
@@ -29,15 +27,13 @@ class DatabaseConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
|
||||
}
|
||||
|
||||
/**
|
||||
* @param InputInterface $input
|
||||
* @param OutputInterface $output
|
||||
* @param SymfonyStyle $io
|
||||
* @param CustomizableAppConfig $appConfig
|
||||
* @return void
|
||||
* @throws IOException
|
||||
*/
|
||||
public function process(InputInterface $input, OutputInterface $output, CustomizableAppConfig $appConfig)
|
||||
public function process(SymfonyStyle $io, CustomizableAppConfig $appConfig)
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
$io->title('DATABASE');
|
||||
|
||||
if ($appConfig->hasDatabase() && $io->confirm('Do you want to keep imported database config?')) {
|
||||
|
||||
@@ -4,8 +4,6 @@ declare(strict_types=1);
|
||||
namespace Shlinkio\Shlink\CLI\Install\Plugin;
|
||||
|
||||
use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
class LanguageConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
|
||||
@@ -13,14 +11,12 @@ class LanguageConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
|
||||
const SUPPORTED_LANGUAGES = ['en', 'es'];
|
||||
|
||||
/**
|
||||
* @param InputInterface $input
|
||||
* @param OutputInterface $output
|
||||
* @param SymfonyStyle $io
|
||||
* @param CustomizableAppConfig $appConfig
|
||||
* @return void
|
||||
*/
|
||||
public function process(InputInterface $input, OutputInterface $output, CustomizableAppConfig $appConfig)
|
||||
public function process(SymfonyStyle $io, CustomizableAppConfig $appConfig)
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
$io->title('LANGUAGE');
|
||||
|
||||
if ($appConfig->hasLanguage() && $io->confirm('Do you want to keep imported language?')) {
|
||||
|
||||
@@ -5,21 +5,17 @@ namespace Shlinkio\Shlink\CLI\Install\Plugin;
|
||||
|
||||
use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Shlinkio\Shlink\Core\Service\UrlShortener;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
class UrlShortenerConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
|
||||
{
|
||||
/**
|
||||
* @param InputInterface $input
|
||||
* @param OutputInterface $output
|
||||
* @param SymfonyStyle $io
|
||||
* @param CustomizableAppConfig $appConfig
|
||||
* @return void
|
||||
*/
|
||||
public function process(InputInterface $input, OutputInterface $output, CustomizableAppConfig $appConfig)
|
||||
public function process(SymfonyStyle $io, CustomizableAppConfig $appConfig)
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
$io->title('URL SHORTENER');
|
||||
|
||||
if ($appConfig->hasUrlShortener() && $io->confirm('Do you want to keep imported URL shortener config?')) {
|
||||
|
||||
Reference in New Issue
Block a user