mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-22 15:13:59 -06:00
Removed plugin suffix on config ustomizers
This commit is contained in:
parent
0e2ad0dbca
commit
0f0213aa87
@ -2,7 +2,7 @@
|
||||
<?php
|
||||
|
||||
use Shlinkio\Shlink\CLI\Factory\InstallApplicationFactory;
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\DatabaseConfigCustomizerPlugin;
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\DatabaseConfigCustomizer;
|
||||
use Symfony\Component\Console\Application;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
||||
@ -21,7 +21,7 @@ $container = new ServiceManager([
|
||||
'services' => [
|
||||
'config' => [
|
||||
ConfigAbstractFactory::class => [
|
||||
DatabaseConfigCustomizerPlugin::class => [Filesystem::class]
|
||||
DatabaseConfigCustomizer::class => [Filesystem::class]
|
||||
],
|
||||
],
|
||||
],
|
||||
|
@ -2,7 +2,7 @@
|
||||
<?php
|
||||
|
||||
use Shlinkio\Shlink\CLI\Factory\InstallApplicationFactory;
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\DatabaseConfigCustomizerPlugin;
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\DatabaseConfigCustomizer;
|
||||
use Symfony\Component\Console\Application;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
||||
@ -21,7 +21,7 @@ $container = new ServiceManager([
|
||||
'services' => [
|
||||
'config' => [
|
||||
ConfigAbstractFactory::class => [
|
||||
DatabaseConfigCustomizerPlugin::class => [Filesystem::class]
|
||||
DatabaseConfigCustomizer::class => [Filesystem::class]
|
||||
],
|
||||
],
|
||||
],
|
||||
|
@ -116,12 +116,12 @@ class InstallCommand extends Command
|
||||
|
||||
// Ask for custom config params
|
||||
foreach ([
|
||||
Plugin\DatabaseConfigCustomizerPlugin::class,
|
||||
Plugin\UrlShortenerConfigCustomizerPlugin::class,
|
||||
Plugin\LanguageConfigCustomizerPlugin::class,
|
||||
Plugin\ApplicationConfigCustomizerPlugin::class,
|
||||
Plugin\DatabaseConfigCustomizer::class,
|
||||
Plugin\UrlShortenerConfigCustomizer::class,
|
||||
Plugin\LanguageConfigCustomizer::class,
|
||||
Plugin\ApplicationConfigCustomizer::class,
|
||||
] as $pluginName) {
|
||||
/** @var Plugin\ConfigCustomizerPluginInterface $configCustomizer */
|
||||
/** @var Plugin\ConfigCustomizerInterface $configCustomizer */
|
||||
$configCustomizer = $this->configCustomizers->get($pluginName);
|
||||
$configCustomizer->process($this->io, $config);
|
||||
}
|
||||
|
@ -42,10 +42,10 @@ class InstallApplicationFactory implements FactoryInterface
|
||||
new PhpArray(),
|
||||
$container->get(Filesystem::class),
|
||||
new ConfigCustomizerPluginManager($container, ['factories' => [
|
||||
Plugin\DatabaseConfigCustomizerPlugin::class => ConfigAbstractFactory::class,
|
||||
Plugin\UrlShortenerConfigCustomizerPlugin::class => InvokableFactory::class,
|
||||
Plugin\LanguageConfigCustomizerPlugin::class => InvokableFactory::class,
|
||||
Plugin\ApplicationConfigCustomizerPlugin::class => InvokableFactory::class,
|
||||
Plugin\DatabaseConfigCustomizer::class => ConfigAbstractFactory::class,
|
||||
Plugin\UrlShortenerConfigCustomizer::class => InvokableFactory::class,
|
||||
Plugin\LanguageConfigCustomizer::class => InvokableFactory::class,
|
||||
Plugin\ApplicationConfigCustomizer::class => InvokableFactory::class,
|
||||
]]),
|
||||
$isUpdate
|
||||
);
|
||||
|
@ -3,10 +3,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\CLI\Install;
|
||||
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\ConfigCustomizerPluginInterface;
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\ConfigCustomizerInterface;
|
||||
use Zend\ServiceManager\AbstractPluginManager;
|
||||
|
||||
class ConfigCustomizerPluginManager extends AbstractPluginManager implements ConfigCustomizerPluginManagerInterface
|
||||
{
|
||||
protected $instanceOf = ConfigCustomizerPluginInterface::class;
|
||||
protected $instanceOf = ConfigCustomizerInterface::class;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ namespace Shlinkio\Shlink\CLI\Install\Plugin;
|
||||
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
abstract class AbstractConfigCustomizerPlugin implements ConfigCustomizerPluginInterface
|
||||
abstract class AbstractConfigCustomizer implements ConfigCustomizerInterface
|
||||
{
|
||||
/**
|
||||
* @param SymfonyStyle $io
|
@ -7,7 +7,7 @@ use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Shlinkio\Shlink\Common\Util\StringUtilsTrait;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
class ApplicationConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
|
||||
class ApplicationConfigCustomizer extends AbstractConfigCustomizer
|
||||
{
|
||||
use StringUtilsTrait;
|
||||
|
@ -6,7 +6,7 @@ namespace Shlinkio\Shlink\CLI\Install\Plugin;
|
||||
use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
interface ConfigCustomizerPluginInterface
|
||||
interface ConfigCustomizerInterface
|
||||
{
|
||||
/**
|
||||
* @param SymfonyStyle $io
|
@ -8,7 +8,7 @@ use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Symfony\Component\Filesystem\Exception\IOException;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
|
||||
class DatabaseConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
|
||||
class DatabaseConfigCustomizer extends AbstractConfigCustomizer
|
||||
{
|
||||
const DATABASE_DRIVERS = [
|
||||
'MySQL' => 'pdo_mysql',
|
@ -6,7 +6,7 @@ namespace Shlinkio\Shlink\CLI\Install\Plugin;
|
||||
use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
class LanguageConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
|
||||
class LanguageConfigCustomizer extends AbstractConfigCustomizer
|
||||
{
|
||||
const SUPPORTED_LANGUAGES = ['en', 'es'];
|
||||
|
@ -7,7 +7,7 @@ use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Shlinkio\Shlink\Core\Service\UrlShortener;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
|
||||
class UrlShortenerConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
|
||||
class UrlShortenerConfigCustomizer extends AbstractConfigCustomizer
|
||||
{
|
||||
/**
|
||||
* @param SymfonyStyle $io
|
@ -9,7 +9,7 @@ use Prophecy\Prophecy\MethodProphecy;
|
||||
use Prophecy\Prophecy\ObjectProphecy;
|
||||
use Shlinkio\Shlink\CLI\Command\Install\InstallCommand;
|
||||
use Shlinkio\Shlink\CLI\Install\ConfigCustomizerPluginManagerInterface;
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\ConfigCustomizerPluginInterface;
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\ConfigCustomizerInterface;
|
||||
use Symfony\Component\Console\Application;
|
||||
use Symfony\Component\Console\Helper\ProcessHelper;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
@ -51,7 +51,7 @@ class InstallCommandTest extends TestCase
|
||||
|
||||
$this->configWriter = $this->prophesize(WriterInterface::class);
|
||||
|
||||
$configCustomizer = $this->prophesize(ConfigCustomizerPluginInterface::class);
|
||||
$configCustomizer = $this->prophesize(ConfigCustomizerInterface::class);
|
||||
$configCustomizers = $this->prophesize(ConfigCustomizerPluginManagerInterface::class);
|
||||
$configCustomizers->get(Argument::cetera())->willReturn($configCustomizer->reveal());
|
||||
|
||||
|
@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase;
|
||||
use Prophecy\Argument;
|
||||
use Prophecy\Prophecy\MethodProphecy;
|
||||
use Prophecy\Prophecy\ObjectProphecy;
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\ApplicationConfigCustomizerPlugin;
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\ApplicationConfigCustomizer;
|
||||
use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Symfony\Component\Console\Helper\QuestionHelper;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
@ -18,7 +18,7 @@ use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
class ApplicationConfigCustomizerPluginTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var ApplicationConfigCustomizerPlugin
|
||||
* @var ApplicationConfigCustomizer
|
||||
*/
|
||||
private $plugin;
|
||||
/**
|
||||
@ -29,7 +29,7 @@ class ApplicationConfigCustomizerPluginTest extends TestCase
|
||||
public function setUp()
|
||||
{
|
||||
$this->questionHelper = $this->prophesize(QuestionHelper::class);
|
||||
$this->plugin = new ApplicationConfigCustomizerPlugin($this->questionHelper->reveal());
|
||||
$this->plugin = new ApplicationConfigCustomizer($this->questionHelper->reveal());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase;
|
||||
use Prophecy\Argument;
|
||||
use Prophecy\Prophecy\MethodProphecy;
|
||||
use Prophecy\Prophecy\ObjectProphecy;
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\DatabaseConfigCustomizerPlugin;
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\DatabaseConfigCustomizer;
|
||||
use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Symfony\Component\Console\Helper\QuestionHelper;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
@ -19,7 +19,7 @@ use Symfony\Component\Filesystem\Filesystem;
|
||||
class DatabaseConfigCustomizerPluginTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var DatabaseConfigCustomizerPlugin
|
||||
* @var DatabaseConfigCustomizer
|
||||
*/
|
||||
private $plugin;
|
||||
/**
|
||||
@ -36,7 +36,7 @@ class DatabaseConfigCustomizerPluginTest extends TestCase
|
||||
$this->questionHelper = $this->prophesize(QuestionHelper::class);
|
||||
$this->filesystem = $this->prophesize(Filesystem::class);
|
||||
|
||||
$this->plugin = new DatabaseConfigCustomizerPlugin(
|
||||
$this->plugin = new DatabaseConfigCustomizer(
|
||||
$this->questionHelper->reveal(),
|
||||
$this->filesystem->reveal()
|
||||
);
|
||||
|
@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase;
|
||||
use Prophecy\Argument;
|
||||
use Prophecy\Prophecy\MethodProphecy;
|
||||
use Prophecy\Prophecy\ObjectProphecy;
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\LanguageConfigCustomizerPlugin;
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\LanguageConfigCustomizer;
|
||||
use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Symfony\Component\Console\Helper\QuestionHelper;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
@ -18,7 +18,7 @@ use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
class LanguageConfigCustomizerPluginTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var LanguageConfigCustomizerPlugin
|
||||
* @var LanguageConfigCustomizer
|
||||
*/
|
||||
protected $plugin;
|
||||
/**
|
||||
@ -29,7 +29,7 @@ class LanguageConfigCustomizerPluginTest extends TestCase
|
||||
public function setUp()
|
||||
{
|
||||
$this->questionHelper = $this->prophesize(QuestionHelper::class);
|
||||
$this->plugin = new LanguageConfigCustomizerPlugin($this->questionHelper->reveal());
|
||||
$this->plugin = new LanguageConfigCustomizer($this->questionHelper->reveal());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase;
|
||||
use Prophecy\Argument;
|
||||
use Prophecy\Prophecy\MethodProphecy;
|
||||
use Prophecy\Prophecy\ObjectProphecy;
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\UrlShortenerConfigCustomizerPlugin;
|
||||
use Shlinkio\Shlink\CLI\Install\Plugin\UrlShortenerConfigCustomizer;
|
||||
use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
|
||||
use Symfony\Component\Console\Helper\QuestionHelper;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
@ -18,7 +18,7 @@ use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
class UrlShortenerConfigCustomizerPluginTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var UrlShortenerConfigCustomizerPlugin
|
||||
* @var UrlShortenerConfigCustomizer
|
||||
*/
|
||||
private $plugin;
|
||||
/**
|
||||
@ -29,7 +29,7 @@ class UrlShortenerConfigCustomizerPluginTest extends TestCase
|
||||
public function setUp()
|
||||
{
|
||||
$this->questionHelper = $this->prophesize(QuestionHelper::class);
|
||||
$this->plugin = new UrlShortenerConfigCustomizerPlugin($this->questionHelper->reveal());
|
||||
$this->plugin = new UrlShortenerConfigCustomizer($this->questionHelper->reveal());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user