public dumpNode ( Symfony\Component\Config\Definition\NodeInterface $node ) | ||
$node | Symfony\Component\Config\Definition\NodeInterface |
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $analyzerConfiguration = Analyzer\Factory::getPassesConfigurations(); $configuration = new Configuration([], $analyzerConfiguration); $configTree = $configuration->getConfigTreeBuilder($analyzerConfiguration)->buildTree(); $dumper = new YamlReferenceDumper(); $output->writeln($dumper->dumpNode($configTree)); }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $output->writeln('<info># Default configuration for "Migraine"</info>'); $dumper = new YamlReferenceDumper(); $contents = ''; $node = $this->getConfiguration()->getConfigTreeBuilder()->buildTree(); foreach ($node->getChildren() as $childNode) { $contents .= $dumper->dumpNode($childNode); } $output->writeln($contents); }
/** * @param string $gadget * @return string * @throws \Exception */ public function dump($gadget = null) { /** @var ArrayNode $tree */ $node = (new TreeFactory())->createTree($this->repository); if ($gadget) { $children = $node->getChildren(); if (!isset($children[$gadget])) { throw new \Exception(sprintf('gadget "%s" not exists', $gadget)); } $node = $children[$gadget]; } $dumper = new YamlReferenceDumper(); return $dumper->dumpNode($node); }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { if (file_exists(Configuration::NAME) && $input->getOption('force') === false) { $output->writeln('<error>Configuration file already exists.</error>'); $output->writeln('<comment>To overwrite it use `--force` option.</comment>'); return; } $contents = ''; $dumper = new YamlReferenceDumper(); $node = $this->getConfiguration()->getConfigTreeBuilder()->buildTree(); foreach ($node->getChildren() as $childNode) { $contents .= $dumper->dumpNode($childNode); } file_put_contents(Configuration::NAME, trim($contents)); $output->writeln('<info>Configuration file created successfully!</info>'); }