Skip to content

Commit b3d1a7b

Browse files
committed
Merge branch '2.3' into 2.7
* 2.3: [2.7] Fixed flatten exception recursion with errors Embedded identifier support Change the ExtensionInterface load method definition to bo identical to the documentation. add and correct armenian translations [Config] Fix array sort on normalization in edge case [Yaml] fix indented line handling in folded blocks improve BrowserKit test coverage p1
2 parents 49268ec + 665c0ae commit b3d1a7b

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Definition/ArrayNode.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,17 @@ protected function preNormalize($value)
5555
return $value;
5656
}
5757

58+
$normalized = array();
59+
5860
foreach ($value as $k => $v) {
5961
if (false !== strpos($k, '-') && false === strpos($k, '_') && !array_key_exists($normalizedKey = str_replace('-', '_', $k), $value)) {
60-
$value[$normalizedKey] = $v;
61-
unset($value[$k]);
62+
$normalized[$normalizedKey] = $v;
63+
} else {
64+
$normalized[$k] = $v;
6265
}
6366
}
6467

65-
return $value;
68+
return $normalized;
6669
}
6770

6871
/**

Tests/Definition/ArrayNodeTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ public function getPreNormalizationTests()
7474
array('foo-bar_moo' => 'foo'),
7575
array('foo-bar_moo' => 'foo'),
7676
),
77+
array(
78+
array('anything-with-dash-and-no-underscore' => 'first', 'no_dash' => 'second'),
79+
array('anything_with_dash_and_no_underscore' => 'first', 'no_dash' => 'second'),
80+
),
7781
array(
7882
array('foo-bar' => null, 'foo_bar' => 'foo'),
7983
array('foo-bar' => null, 'foo_bar' => 'foo'),

0 commit comments

Comments
 (0)