From d96023d0632aa2132767c3c7277abc5de13732df Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 11 Aug 2019 20:34:55 +0200 Subject: [PATCH] Used class from shlink-installer instead of duplicated local version --- module/CLI/config/dependencies.config.php | 3 +- .../CLI/src/Factory/ProcessHelperFactory.php | 20 ------------- .../test/Factory/ProcessHelperFactoryTest.php | 29 ------------------- 3 files changed, 2 insertions(+), 50 deletions(-) delete mode 100644 module/CLI/src/Factory/ProcessHelperFactory.php delete mode 100644 module/CLI/test/Factory/ProcessHelperFactoryTest.php diff --git a/module/CLI/config/dependencies.config.php b/module/CLI/config/dependencies.config.php index 2376e5af..a307f48a 100644 --- a/module/CLI/config/dependencies.config.php +++ b/module/CLI/config/dependencies.config.php @@ -8,6 +8,7 @@ use GeoIp2\Database\Reader; use Shlinkio\Shlink\CLI\Util\GeolocationDbUpdater; use Shlinkio\Shlink\Common\Doctrine\NoDbNameConnectionFactory; use Shlinkio\Shlink\Core\Service; +use Shlinkio\Shlink\Installer\Factory\ProcessHelperFactory; use Shlinkio\Shlink\IpGeolocation\GeoLite2\DbUpdater; use Shlinkio\Shlink\IpGeolocation\Resolver\IpLocationResolverInterface; use Shlinkio\Shlink\PreviewGenerator\Service\PreviewGenerator; @@ -23,7 +24,7 @@ return [ 'dependencies' => [ 'factories' => [ SymfonyCli\Application::class => Factory\ApplicationFactory::class, - SymfonyCli\Helper\ProcessHelper::class => Factory\ProcessHelperFactory::class, + SymfonyCli\Helper\ProcessHelper::class => ProcessHelperFactory::class, PhpExecutableFinder::class => InvokableFactory::class, GeolocationDbUpdater::class => ConfigAbstractFactory::class, diff --git a/module/CLI/src/Factory/ProcessHelperFactory.php b/module/CLI/src/Factory/ProcessHelperFactory.php deleted file mode 100644 index 005d513d..00000000 --- a/module/CLI/src/Factory/ProcessHelperFactory.php +++ /dev/null @@ -1,20 +0,0 @@ -setHelperSet(new Helper\HelperSet([ - new Helper\FormatterHelper(), - new Helper\DebugFormatterHelper(), - ])); - - return $processHelper; - } -} diff --git a/module/CLI/test/Factory/ProcessHelperFactoryTest.php b/module/CLI/test/Factory/ProcessHelperFactoryTest.php deleted file mode 100644 index 5042fb73..00000000 --- a/module/CLI/test/Factory/ProcessHelperFactoryTest.php +++ /dev/null @@ -1,29 +0,0 @@ -factory = new ProcessHelperFactory(); - } - - /** @test */ - public function createsTheServiceWithTheProperSetOfHelpers(): void - { - $processHelper = ($this->factory)(); - $helperSet = $processHelper->getHelperSet(); - - $this->assertCount(2, $helperSet); - $this->assertTrue($helperSet->has('formatter')); - $this->assertTrue($helperSet->has('debug_formatter')); - } -}