public dump ( Symfony\Component\Config\Definition\ConfigurationInterface $configuration ) | ||
$configuration | Symfony\Component\Config\Definition\ConfigurationInterface |
public function testDumper() { $configuration = new ExampleConfiguration(); $dumper = new YamlReferenceDumper(); $this->markTestIncomplete('The Yaml Dumper currently does not support prototyped arrays'); $this->assertEquals($this->getConfigurationAsString(), $dumper->dump($configuration)); }
protected function execute(InputInterface $input, OutputInterface $output) { $configArgument = $input->getArgument('config'); if (false === file_exists($configArgument)) { throw new FileNotFoundException(sprintf('configuration file : "%s" can not be found', $configArgument)); } $output->write('1 - Parse config file : '); $parser = new Parser(); $config = $parser->parse(file_get_contents($configArgument)); unset($parser); $output->writeln('<info>Ok</info>'); $output->write('2 - Load Resolver and Generators : '); $processor = new Processor(); $workerConfiguration = $processor->process($this->configurationTree->getWorkerTree(), ['root' => $config]); $generators = $this->generatorChain->getGenerators($workerConfiguration['generators']); $resolvers = $this->resolverChain->getResolvers($workerConfiguration['resolvers']); $output->writeln('<info>Ok</info>'); $output->write('3 - Build configuration tree : '); foreach (array_merge($generators, $resolvers) as $worker) { if ($worker instanceof TreeConfiguratorInterface) { $this->configurationTree->addTreeConfigurator($worker); } } $output->writeln('<info>Ok</info>'); $dumper = new YamlReferenceDumper(); echo $dumper->dump($this->configurationTree); }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $configuration = new TypesGeneratorConfiguration(); $dumper = new YamlReferenceDumper(); $output->writeln($dumper->dump($configuration)); }
public function testDumper() { $configuration = new ExampleConfiguration(); $dumper = new YamlReferenceDumper(); $this->assertEquals($this->getConfigurationAsString(), $dumper->dump($configuration)); }
/** * Writes the formatted configuration to the output manager. * * @param OutputInterface $output The output manager. * @param string $format The output format. * @param ConfigurationInterface $configuration The configuration. * * @throws InvalidArgumentException If the format is not supported. */ protected function writeConfiguration(OutputInterface $output, $format, ConfigurationInterface $configuration) { switch ($format) { case 'xml': $dumper = new XmlReferenceDumper(); $helper = $this->getHelper('xml'); break; case 'yaml': $dumper = new YamlReferenceDumper(); $helper = $this->getHelper('yaml'); break; // @codeCoverageIgnoreStart // @codeCoverageIgnoreStart default: throw new InvalidArgumentException("The format \"{$format}\" is not supported."); } // @codeCoverageIgnoreEnd $output->write($helper->colorize($dumper->dump($configuration))); }
public function dumpConfiguration() { $dumper = new YamlReferenceDumper($this->importer); $string = ''; $string .= $dumper->dump($this->getImporterByName('workspace_properties')); $string .= $dumper->dump($this->getImporterByName('owner')); $string .= $dumper->dump($this->getImporterByName('user')); $string .= $dumper->dump($this->getImporterByName('groups')); $string .= $dumper->dump($this->getImporterByName('roles')); $string .= $dumper->dump($this->getImporterByName('tools')); $string .= $dumper->dump($this->getImporterByName('forum')); return $string; }