Skip to content

Commit

Permalink
Implemented possibility to skip key normalization in config processing
Browse files Browse the repository at this point in the history
  • Loading branch information
lolautruche authored and fabpot committed Dec 5, 2012
1 parent 559fa8c commit 5e8d401
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions src/Symfony/Component/Config/Definition/Processor.php
Expand Up @@ -23,12 +23,15 @@ class Processor
*
* @param NodeInterface $configTree The node tree describing the configuration
* @param array $configs An array of configuration items to process
* @param bool $normalizeKeys Flag indicating if config key normalization is needed. True by default.
*
* @return array The processed configuration
*/
public function process(NodeInterface $configTree, array $configs)
public function process(NodeInterface $configTree, array $configs, $normalizeKeys = true)
{
$configs = self::normalizeKeys($configs);
if ($normalizeKeys) {
$configs = self::normalizeKeys($configs);
}

$currentConfig = array();
foreach ($configs as $config) {
Expand All @@ -44,12 +47,13 @@ public function process(NodeInterface $configTree, array $configs)
*
* @param ConfigurationInterface $configuration The configuration class
* @param array $configs An array of configuration items to process
* @param bool $normalizeKeys Flag indicating if config key normalization is needed. True by default.
*
* @return array The processed configuration
*/
public function processConfiguration(ConfigurationInterface $configuration, array $configs)
public function processConfiguration(ConfigurationInterface $configuration, array $configs, $normalizeKeys = true)
{
return $this->process($configuration->getConfigTreeBuilder()->buildTree(), $configs);
return $this->process($configuration->getConfigTreeBuilder()->buildTree(), $configs, $normalizeKeys);
}

/**
Expand Down
Expand Up @@ -96,11 +96,11 @@ public function getAlias()
return Container::underscore($classBaseName);
}

final protected function processConfiguration(ConfigurationInterface $configuration, array $configs)
final protected function processConfiguration(ConfigurationInterface $configuration, array $configs, $normalizeKeys = true)
{
$processor = new Processor();

return $processor->processConfiguration($configuration, $configs);
return $processor->processConfiguration($configuration, $configs, $normalizeKeys);
}

/**
Expand Down

0 comments on commit 5e8d401

Please sign in to comment.