8000 [Config] renamed keepKeys() to normalizeKeys() (refs #6367) · loicfrering/symfony@8df9b7a · GitHub
[go: up one dir, main page]

Skip to content

Commit 8df9b7a

Browse files
committed
[Config] renamed keepKeys() to normalizeKeys() (refs symfony#6367)
1 parent 4f0cf08 commit 8df9b7a

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private function addGlobalsSection(ArrayNodeDefinition $rootNode)
7676
->fixXmlConfig('global')
7777
->children()
7878
->arrayNode('globals')
79-
->keepKeys()
79+
->normalizeKeys(false)
8080
->useAttributeAsKey('key')
8181
->example(array('foo' => '"@bar"', 'pi' => 3.14))
8282
->prototype('array')
@@ -127,7 +127,7 @@ private function addTwigOptions(ArrayNodeDefinition $rootNode)
127127
->scalarNode('auto_reload')->end()
128128
->scalarNode('optimizations')->end()
129129
->arrayNode('paths')
130-
->keepKeys()
130+
->normalizeKeys(false)
131131
->beforeNormalization()
132132
->always()
133133
->then(function ($paths) {

src/Symfony/Component/Config/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CHANGELOG
44
2.2.0
55
-----
66

7-
* added a `keepKeys()` method for array nodes (to avoid key normalization)
7+
* added a `normalizeKeys()` method for array nodes (to avoid key normalization)
88
* added numerical type handling for config definitions
99
* added convenience methods for optional configuration sections to ArrayNodeDefinition
1010
* added a utils class for XML manipulations

src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,15 @@ public function ignoreExtraKeys()
284284
}
285285

286286
/**
287-
* Disables key normalization.
287+
* Sets key normalization.
288+
*
289+
* @param Boolean $bool Whether to enable key normalization
288290
*
289291
* @return ArrayNodeDefinition
290292
*/
291-
public function keepKeys()
293+
public function normalizeKeys($bool)
292294
{
293-
$this->normalizeKeys = false;
295+
$this->normalizeKeys = (Boolean) $bool;
294296

295297
return $this;
296298
}

0 commit comments

Comments
 (0)
0