Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 566d16f

Browse filesBrowse files
committed
[Messenger] Messenger options were merged with numbers as keys.
Allow named keys on right side to be merged without restriction on key-name (when useAttributeAsKey($keyName) is used).
1 parent a0f286d commit 566d16f
Copy full SHA for 566d16f

File tree

3 files changed

+17
-3
lines changed
Filter options

3 files changed

+17
-3
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,6 @@ function ($a) {
12671267
->scalarNode('dsn')->end()
12681268
->scalarNode('serializer')->defaultNull()->info('Service id of a custom serializer to use.')->end()
12691269
->arrayNode('options')
1270-
->useAttributeAsKey('option')
12711270
->normalizeKeys(false)
12721271
->defaultValue([])
12731272
->prototype('variable')

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,13 @@ public function testMessengerMergeConfigsTransportOptions()
303303
'options' => [
304304
'wait_time' => 20,
305305
'option' => 'bar',
306+
'queue' => [
307+
'name' => 'Queue',
308+
'option' => 'foo',
309+
'queue_options' => [
310+
'option' => 'foo',
311+
],
312+
],
306313
],
307314
],
308315
],
@@ -315,6 +322,13 @@ public function testMessengerMergeConfigsTransportOptions()
315322
'auto_setup' => true,
316323
'option' => 'bar',
317324
'wait_time' => 20,
325+
'queue' => [
326+
'name' => 'Queue',
327+
'option' => 'foo',
328+
'queue_options' => [
329+
'option' => 'foo',
330+
],
331+
],
318332
],
319333
$config['messenger']['transports']['async']['options']
320334
);

‎src/Symfony/Component/Config/Definition/PrototypedArrayNode.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Definition/PrototypedArrayNode.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,10 @@ protected function mergeValues($leftSide, $rightSide)
304304
return $rightSide;
305305
}
306306

307+
$isAssoc = array_keys($rightSide) !== range(0, \count($rightSide) - 1);
307308
foreach ($rightSide as $k => $v) {
308-
// prototype, and key is irrelevant, append the element
309-
if (null === $this->keyAttribute) {
309+
// prototype, and key is irrelevant there are no named keys, append the element
310+
if (null === $this->keyAttribute && !$isAssoc) {
310311
$leftSide[] = $v;
311312
continue;
312313
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.