Skip to content

Commit

Permalink
[Config] renamed keepKeys() to normalizeKeys() (refs #6367)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Dec 16, 2012
1 parent 4f0cf08 commit 8df9b7a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private function addGlobalsSection(ArrayNodeDefinition $rootNode)
->fixXmlConfig('global')
->children()
->arrayNode('globals')
->keepKeys()
->normalizeKeys(false)
->useAttributeAsKey('key')
->example(array('foo' => '"@bar"', 'pi' => 3.14))
->prototype('array')
Expand Down Expand Up @@ -127,7 +127,7 @@ private function addTwigOptions(ArrayNodeDefinition $rootNode)
->scalarNode('auto_reload')->end()
->scalarNode('optimizations')->end()
->arrayNode('paths')
->keepKeys()
->normalizeKeys(false)
->beforeNormalization()
->always()
->then(function ($paths) {
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Config/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CHANGELOG
2.2.0
-----

* added a `keepKeys()` method for array nodes (to avoid key normalization)
* added a `normalizeKeys()` method for array nodes (to avoid key normalization)
* added numerical type handling for config definitions
* added convenience methods for optional configuration sections to ArrayNodeDefinition
* added a utils class for XML manipulations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,15 @@ public function ignoreExtraKeys()
}

/**
* Disables key normalization.
* Sets key normalization.
*
* @param Boolean $bool Whether to enable key normalization
*
* @return ArrayNodeDefinition
*/
public function keepKeys()
public function normalizeKeys($bool)
{
$this->normalizeKeys = false;
$this->normalizeKeys = (Boolean) $bool;

return $this;
}
Expand Down

0 comments on commit 8df9b7a

Please sign in to comment.