Skip to content

Commit

Permalink
Remove hard dependencies to set configTypes and get them dynamically …
Browse files Browse the repository at this point in the history
…instead
  • Loading branch information
jalogut committed Nov 28, 2017
1 parent 0812ba8 commit 6751504
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ class ApplicationDumpCommand extends Command
{
const INPUT_CONFIG_TYPES = 'config-types';

/**
* @var array
*/
private $configTypes = [
\Magento\Store\App\Config\Type\Scopes::CONFIG_TYPE,
\Magento\Deploy\Source\Themes::TYPE,
\Magento\Translation\App\Config\Type\Translation::CONFIG_TYPE,
\Magento\Config\App\Config\Type\System::CONFIG_TYPE,
];

/**
* @var Writer
*/
Expand Down Expand Up @@ -60,10 +50,10 @@ public function __construct(
array $sources,
Hash $configHash = null
) {
parent::__construct();
$this->writer = $writer;
$this->sources = $sources;
$this->configHash = $configHash ?: ObjectManager::getInstance()->get(Hash::class);
parent::__construct();
}

/**
Expand All @@ -73,10 +63,12 @@ protected function configure()
{
$this->setName('app:config:dump');
$this->setDescription('Create dump of application');

$configTypes = array_unique(array_column($this->sources, 'namespace'));
$this->addArgument(
self::INPUT_CONFIG_TYPES,
InputArgument::OPTIONAL | InputArgument::IS_ARRAY,
sprintf('Space-separated list of config types or omit to dump all [%s]', implode(', ', $this->configTypes))
sprintf('Space-separated list of config types or omit to dump all [%s]', implode(', ', $configTypes))
);
parent::configure();
}
Expand Down

0 comments on commit 6751504

Please sign in to comment.