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 453c3a7

Browse filesBrowse files
bug #37268 [Messenger] Fix precedence of DSN options for 4.4 (jderusse)
This PR was merged into the 4.4 branch. Discussion ---------- [Messenger] Fix precedence of DSN options for 4.4 | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #37218 (comment) | License | MIT | Doc PR | N/A This PR fix précédence of DSN options over constructor options in all component on branch 4.4 Commits ------- 992205a Fix precendence in 4.4
2 parents a6e3789 + 992205a commit 453c3a7
Copy full SHA for 453c3a7

File tree

2 files changed

+6
-6
lines changed
Filter options

2 files changed

+6
-6
lines changed

‎src/Symfony/Component/Messenger/Tests/Transport/Doctrine/ConnectionTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Tests/Transport/Doctrine/ConnectionTest.php
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public function buildConfigurationProvider(): iterable
209209
'expectedAutoSetup' => false,
210210
];
211211

212-
yield 'options from options array wins over options from dsn' => [
212+
yield 'options from dsn array wins over options from options' => [
213213
'dsn' => 'doctrine://default?table_name=name_from_dsn&redeliver_timeout=1200&queue_name=normal&auto_setup=true',
214214
'options' => [
215215
'table_name' => 'name_from_options',
@@ -218,10 +218,10 @@ public function buildConfigurationProvider(): iterable
218218
'auto_setup' => false,
219219
],
220220
'expectedConnection' => 'default',
221-
'expectedTableName' => 'name_from_options',
222-
'expectedRedeliverTimeout' => 1800,
223-
'expectedQueue' => 'important',
224-
'expectedAutoSetup' => false,
221+
'expectedTableName' => 'name_from_dsn',
222+
'expectedRedeliverTimeout' => 1200,
223+
'expectedQueue' => 'normal',
224+
'expectedAutoSetup' => true,
225225
];
226226

227227
yield 'options from dsn with falsey boolean' => [

‎src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static function buildConfiguration(string $dsn, array $options = []): arr
8585
}
8686

8787
$configuration = ['connection' => $components['host']];
88-
$configuration += $options + $query + self::DEFAULT_OPTIONS;
88+
$configuration += $query + $options + self::DEFAULT_OPTIONS;
8989

9090
$configuration['auto_setup'] = filter_var($configuration['auto_setup'], FILTER_VALIDATE_BOOLEAN);
9191

0 commit comments

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