dump() public method

public dump ( Symfony\Component\Config\Definition\ConfigurationInterface $configuration )
$configuration Symfony\Component\Config\Definition\ConfigurationInterface
コード例 #1
0
 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));
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $configuration = new TypesGeneratorConfiguration();
     $dumper = new YamlReferenceDumper();
     $output->writeln($dumper->dump($configuration));
 }
コード例 #4
0
 public function testDumper()
 {
     $configuration = new ExampleConfiguration();
     $dumper = new YamlReferenceDumper();
     $this->assertEquals($this->getConfigurationAsString(), $dumper->dump($configuration));
 }
コード例 #5
0
 /**
  * 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)));
 }
コード例 #6
0
 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;
 }