Permalink
Browse files

OXDEV-1580 Remove not used command providers

  • Loading branch information...
MantasVaitkunas committed Nov 22, 2018
1 parent 3d62cc2 commit cac00d5a623ca054cd75ad2e506d39f7d364f0ad

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -6,6 +6,8 @@
namespace OxidEsales\EshopCommunity\Internal\Console;
use OxidEsales\EshopCommunity\Internal\Console\CommandsProvider\CommandsProviderInterface;
use OxidEsales\EshopCommunity\Internal\Console\CommandsProvider\ServicesCommandsProvider;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
@@ -22,20 +24,20 @@ class Executor implements ExecutorInterface
private $application;
/**
* @var CommandsCollectionBuilder
* @var ServicesCommandsProvider
*/
private $commandsCollectionBuilder;
private $servicesCommandsProvider;
/**
* @param Application $application
* @param CommandsCollectionBuilder $commandsCollectionBuilder
* @param CommandsProviderInterface $commandsProvider
*/
public function __construct(
Application $application,
CommandsCollectionBuilder $commandsCollectionBuilder
CommandsProviderInterface $commandsProvider
) {
$this->application = $application;
$this->commandsCollectionBuilder = $commandsCollectionBuilder;
$this->servicesCommandsProvider = $commandsProvider;
}
/**
@@ -46,7 +48,7 @@ public function __construct(
*/
public function execute(InputInterface $input = null, OutputInterface $output = null)
{
$this->application->addCommands($this->commandsCollectionBuilder->build()->toArray());
$this->application->addCommands($this->servicesCommandsProvider->getCommands());
$this->application->run($input, $output);
}
}
@@ -4,29 +4,12 @@ services:
public: true
arguments:
- '@oxid_esales.console.symfony.component.console.application'
- '@oxid_esales.console.commands_collection_builder'
- '@oxid_esales.console.commands_provider.services_commands_provider'
oxid_esales.console.symfony.component.console.application:
class: Symfony\Component\Console\Application
public: false
oxid_esales.console.commands_collection_builder:
class: OxidEsales\EshopCommunity\Internal\Console\CommandsCollectionBuilder
arguments:
- '@oxid_esales.console.commands_provider.component_commands_provider'
- '@oxid_esales.console.commands_provider.module_commands_provider'
- '@oxid_esales.console.commands_provider.services_commands_provider'
oxid_esales.console.commands_provider.component_commands_provider:
class: OxidEsales\EshopCommunity\Internal\Console\CommandsProvider\ComponentCommandsProvider
public: false
arguments: ['@oxid_esales.console.composer.repository.local_repository']
oxid_esales.console.commands_provider.module_commands_provider:
class: OxidEsales\EshopCommunity\Internal\Console\CommandsProvider\ModuleCommandsProvider
public: false
autowire: true
oxid_esales.console.commands_provider.services_commands_provider:
class: OxidEsales\EshopCommunity\Internal\Console\CommandsProvider\ServicesCommandsProvider
public: false
@@ -6,7 +6,7 @@
namespace OxidEsales\EshopCommunity\Tests\Integration\Internal\Console;
use OxidEsales\EshopCommunity\Internal\Console\CommandsCollectionBuilder;
use OxidEsales\EshopCommunity\Internal\Console\CommandsProvider\CommandsProviderInterface;
use OxidEsales\EshopCommunity\Internal\Console\Executor;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Output\StreamOutput;
@@ -18,13 +18,13 @@
{
/**
* @param Application $application
* @param CommandsCollectionBuilder $commandsCollectionBuilder
* @param CommandsProviderInterface $commandsProvider
* @param $input
* @return string
*/
protected function execute(Application $application, CommandsCollectionBuilder $commandsCollectionBuilder, $input): string
protected function execute(Application $application, CommandsProviderInterface $commandsProvider, $input): string
{
$executor = new Executor($application, $commandsCollectionBuilder);
$executor = new Executor($application, $commandsProvider);
$output = new StreamOutput(fopen('php://memory', 'w', false));
$executor->execute($input, $output);
@@ -19,7 +19,7 @@ public function testModuleActivation()
$moduleId = 'testmodule';
$consoleOutput = $this->execute(
$this->getApplication(),
$this->get('oxid_esales.console.commands_collection_builder'),
$this->get('oxid_esales.console.commands_provider.services_commands_provider'),
new ArrayInput(['command' => 'oe:module:activate', 'module-id' => $moduleId])
);
@@ -39,7 +39,7 @@ public function testWhenModuleAlreadyActive()
$moduleId = 'testmodule';
$consoleOutput = $this->execute(
$this->getApplication(),
$this->get('oxid_esales.console.commands_collection_builder'),
$this->get('oxid_esales.console.commands_provider.services_commands_provider'),
new ArrayInput(['command' => 'oe:module:activate', 'module-id' => $moduleId])
);
@@ -53,7 +53,7 @@ public function testNonExistingModuleActivation()
$moduleId = 'test';
$consoleOutput = $this->execute(
$this->getApplication(),
$this->get('oxid_esales.console.commands_collection_builder'),
$this->get('oxid_esales.console.commands_provider.services_commands_provider'),
new ArrayInput(['command' => 'oe:module:activate', 'module-id' => $moduleId])
);
@@ -23,7 +23,7 @@ public function testModuleDeactivation()
$consoleOutput = $this->execute(
$this->getApplication(),
$this->get('oxid_esales.console.commands_collection_builder'),
$this->get('oxid_esales.console.commands_provider.services_commands_provider'),
new ArrayInput(['command' => 'oe:module:deactivate', 'module-id' => $moduleId])
);
@@ -43,7 +43,7 @@ public function testWhenModuleNotActive()
$consoleOutput = $this->execute(
$this->getApplication(),
$this->get('oxid_esales.console.commands_collection_builder'),
$this->get('oxid_esales.console.commands_provider.services_commands_provider'),
new ArrayInput(['command' => 'oe:module:deactivate', 'module-id' => $moduleId])
);
@@ -57,7 +57,7 @@ public function testNonExistingModuleActivation()
$moduleId = 'test';
$consoleOutput = $this->execute(
$this->getApplication(),
$this->get('oxid_esales.console.commands_collection_builder'),
$this->get('oxid_esales.console.commands_provider.services_commands_provider'),
new ArrayInput(['command' => 'oe:module:deactivate', 'module-id' => $moduleId])
);

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit cac00d5

Please sign in to comment.