diff --git a/bin/install b/bin/install index 952c5255..d83df5f6 100755 --- a/bin/install +++ b/bin/install @@ -2,7 +2,7 @@ [ 'config' => [ ConfigAbstractFactory::class => [ - DatabaseConfigCustomizerPlugin::class => [Filesystem::class] + DatabaseConfigCustomizer::class => [Filesystem::class] ], ], ], diff --git a/bin/update b/bin/update index 1534d3a2..ce03fa16 100755 --- a/bin/update +++ b/bin/update @@ -2,7 +2,7 @@ [ 'config' => [ ConfigAbstractFactory::class => [ - DatabaseConfigCustomizerPlugin::class => [Filesystem::class] + DatabaseConfigCustomizer::class => [Filesystem::class] ], ], ], diff --git a/module/CLI/src/Command/Install/InstallCommand.php b/module/CLI/src/Command/Install/InstallCommand.php index 0b641834..59b4f639 100644 --- a/module/CLI/src/Command/Install/InstallCommand.php +++ b/module/CLI/src/Command/Install/InstallCommand.php @@ -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); } diff --git a/module/CLI/src/Factory/InstallApplicationFactory.php b/module/CLI/src/Factory/InstallApplicationFactory.php index b7fd3bb4..0e620bc7 100644 --- a/module/CLI/src/Factory/InstallApplicationFactory.php +++ b/module/CLI/src/Factory/InstallApplicationFactory.php @@ -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 ); diff --git a/module/CLI/src/Install/ConfigCustomizerPluginManager.php b/module/CLI/src/Install/ConfigCustomizerPluginManager.php index 45f2da9a..2e6a2672 100644 --- a/module/CLI/src/Install/ConfigCustomizerPluginManager.php +++ b/module/CLI/src/Install/ConfigCustomizerPluginManager.php @@ -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; } diff --git a/module/CLI/src/Install/Plugin/AbstractConfigCustomizerPlugin.php b/module/CLI/src/Install/Plugin/AbstractConfigCustomizer.php similarity index 89% rename from module/CLI/src/Install/Plugin/AbstractConfigCustomizerPlugin.php rename to module/CLI/src/Install/Plugin/AbstractConfigCustomizer.php index d8ea5b85..f34164a8 100644 --- a/module/CLI/src/Install/Plugin/AbstractConfigCustomizerPlugin.php +++ b/module/CLI/src/Install/Plugin/AbstractConfigCustomizer.php @@ -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 diff --git a/module/CLI/src/Install/Plugin/ApplicationConfigCustomizerPlugin.php b/module/CLI/src/Install/Plugin/ApplicationConfigCustomizer.php similarity index 92% rename from module/CLI/src/Install/Plugin/ApplicationConfigCustomizerPlugin.php rename to module/CLI/src/Install/Plugin/ApplicationConfigCustomizer.php index b507e652..4de42f0c 100644 --- a/module/CLI/src/Install/Plugin/ApplicationConfigCustomizerPlugin.php +++ b/module/CLI/src/Install/Plugin/ApplicationConfigCustomizer.php @@ -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; diff --git a/module/CLI/src/Install/Plugin/ConfigCustomizerPluginInterface.php b/module/CLI/src/Install/Plugin/ConfigCustomizerInterface.php similarity index 90% rename from module/CLI/src/Install/Plugin/ConfigCustomizerPluginInterface.php rename to module/CLI/src/Install/Plugin/ConfigCustomizerInterface.php index 88c08f29..0a2bf054 100644 --- a/module/CLI/src/Install/Plugin/ConfigCustomizerPluginInterface.php +++ b/module/CLI/src/Install/Plugin/ConfigCustomizerInterface.php @@ -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 diff --git a/module/CLI/src/Install/Plugin/DatabaseConfigCustomizerPlugin.php b/module/CLI/src/Install/Plugin/DatabaseConfigCustomizer.php similarity index 97% rename from module/CLI/src/Install/Plugin/DatabaseConfigCustomizerPlugin.php rename to module/CLI/src/Install/Plugin/DatabaseConfigCustomizer.php index faf8c805..8d30994b 100644 --- a/module/CLI/src/Install/Plugin/DatabaseConfigCustomizerPlugin.php +++ b/module/CLI/src/Install/Plugin/DatabaseConfigCustomizer.php @@ -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', diff --git a/module/CLI/src/Install/Plugin/LanguageConfigCustomizerPlugin.php b/module/CLI/src/Install/Plugin/LanguageConfigCustomizer.php similarity index 93% rename from module/CLI/src/Install/Plugin/LanguageConfigCustomizerPlugin.php rename to module/CLI/src/Install/Plugin/LanguageConfigCustomizer.php index d33c9f43..af785155 100644 --- a/module/CLI/src/Install/Plugin/LanguageConfigCustomizerPlugin.php +++ b/module/CLI/src/Install/Plugin/LanguageConfigCustomizer.php @@ -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']; diff --git a/module/CLI/src/Install/Plugin/UrlShortenerConfigCustomizerPlugin.php b/module/CLI/src/Install/Plugin/UrlShortenerConfigCustomizer.php similarity index 94% rename from module/CLI/src/Install/Plugin/UrlShortenerConfigCustomizerPlugin.php rename to module/CLI/src/Install/Plugin/UrlShortenerConfigCustomizer.php index b8ef1b8b..2716d832 100644 --- a/module/CLI/src/Install/Plugin/UrlShortenerConfigCustomizerPlugin.php +++ b/module/CLI/src/Install/Plugin/UrlShortenerConfigCustomizer.php @@ -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 diff --git a/module/CLI/test/Command/Install/InstallCommandTest.php b/module/CLI/test/Command/Install/InstallCommandTest.php index afe83383..45c19c7b 100644 --- a/module/CLI/test/Command/Install/InstallCommandTest.php +++ b/module/CLI/test/Command/Install/InstallCommandTest.php @@ -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()); diff --git a/module/CLI/test/Install/Plugin/ApplicationConfigCustomizerPluginTest.php b/module/CLI/test/Install/Plugin/ApplicationConfigCustomizerPluginTest.php index 96c60fef..f506af26 100644 --- a/module/CLI/test/Install/Plugin/ApplicationConfigCustomizerPluginTest.php +++ b/module/CLI/test/Install/Plugin/ApplicationConfigCustomizerPluginTest.php @@ -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()); } /** diff --git a/module/CLI/test/Install/Plugin/DatabaseConfigCustomizerPluginTest.php b/module/CLI/test/Install/Plugin/DatabaseConfigCustomizerPluginTest.php index 267f309a..097bc05d 100644 --- a/module/CLI/test/Install/Plugin/DatabaseConfigCustomizerPluginTest.php +++ b/module/CLI/test/Install/Plugin/DatabaseConfigCustomizerPluginTest.php @@ -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() ); diff --git a/module/CLI/test/Install/Plugin/LanguageConfigCustomizerPluginTest.php b/module/CLI/test/Install/Plugin/LanguageConfigCustomizerPluginTest.php index eb81d22d..f98c6295 100644 --- a/module/CLI/test/Install/Plugin/LanguageConfigCustomizerPluginTest.php +++ b/module/CLI/test/Install/Plugin/LanguageConfigCustomizerPluginTest.php @@ -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()); } /** diff --git a/module/CLI/test/Install/Plugin/UrlShortenerConfigCustomizerPluginTest.php b/module/CLI/test/Install/Plugin/UrlShortenerConfigCustomizerPluginTest.php index 6a22b713..3fc41a1e 100644 --- a/module/CLI/test/Install/Plugin/UrlShortenerConfigCustomizerPluginTest.php +++ b/module/CLI/test/Install/Plugin/UrlShortenerConfigCustomizerPluginTest.php @@ -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()); } /**