mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-22 08:56:42 -06:00
Used class from shlink-installer instead of duplicated local version
This commit is contained in:
parent
d734d1a3b3
commit
d96023d063
@ -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,
|
||||
|
@ -1,20 +0,0 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\CLI\Factory;
|
||||
|
||||
use Symfony\Component\Console\Helper;
|
||||
|
||||
class ProcessHelperFactory
|
||||
{
|
||||
public function __invoke(): Helper\ProcessHelper
|
||||
{
|
||||
$processHelper = new Helper\ProcessHelper();
|
||||
$processHelper->setHelperSet(new Helper\HelperSet([
|
||||
new Helper\FormatterHelper(),
|
||||
new Helper\DebugFormatterHelper(),
|
||||
]));
|
||||
|
||||
return $processHelper;
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ShlinkioTest\Shlink\CLI\Factory;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Shlinkio\Shlink\Installer\Factory\ProcessHelperFactory;
|
||||
|
||||
class ProcessHelperFactoryTest extends TestCase
|
||||
{
|
||||
/** @var ProcessHelperFactory */
|
||||
private $factory;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->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'));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user