You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Bridge/Amqp/Transport/Connection.php
+42-6Lines changed: 42 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -66,9 +66,21 @@ class Connection
66
66
];
67
67
68
68
privateconstAVAILABLE_QUEUE_OPTIONS = [
69
+
'flags',
70
+
'arguments',
71
+
];
72
+
73
+
privateconstNEW_QUEUE_OPTIONS = [
74
+
'bindings',
75
+
];
76
+
77
+
privateconstDEPRECATED_BINDING_KEYS = [
69
78
'binding_keys',
70
79
'binding_arguments',
71
-
'flags',
80
+
];
81
+
82
+
privateconstAVAILABLE_BINDINGS_OPTIONS = [
83
+
'key',
72
84
'arguments',
73
85
];
74
86
@@ -145,8 +157,11 @@ public function __construct(array $connectionOptions, array $exchangeOptions, ar
145
157
* * connect_timeout: Connection timeout. Note: 0 or greater seconds. May be fractional.
146
158
* * confirm_timeout: Timeout in seconds for confirmation, if none specified transport will not wait for message confirmation. Note: 0 or greater seconds. May be fractional.
147
159
* * queues[name]: An array of queues, keyed by the name
148
-
* * binding_keys: The binding keys (if any) to bind to this queue
149
-
* * binding_arguments: Arguments to be used while binding the queue.
160
+
* * binding_keys: The binding keys (if any) to bind to this queue (Usage is deprecated. See 'bindings')
161
+
* * binding_arguments: Arguments to be used while binding the queue. (Usage is deprecated. See 'bindings')
162
+
* * bindings[name]: An array of bindings for this queue, keyed by the name
163
+
* * key: The binding key (if any) to bind to this queue
164
+
* * arguments: An array of arguments to be used while binding the queue.
150
165
* * flags: Queue flags (Default: AMQP_DURABLE)
151
166
* * arguments: Extra arguments
152
167
* * exchange:
@@ -261,9 +276,24 @@ private static function validateOptions(array $options): void
261
276
continue;
262
277
}
263
278
264
-
if (0 < \count($invalidQueueOptions = array_diff(array_keys($queue), self::AVAILABLE_QUEUE_OPTIONS))) {
279
+
if (0 < \count($deprecatedQueueOptions = array_intersect(array_keys($queue), self::DEPRECATED_BINDING_KEYS))) {
280
+
trigger_deprecation('symfony/messenger', '6.3', 'Deprecated queue option(s) "%s" passed to the AMQP Messenger transport. The "%s" option(s) should be used rather than "%s".', implode('", "', $deprecatedQueueOptions), implode('", ', self::NEW_QUEUE_OPTIONS), implode('", ', self::DEPRECATED_BINDING_KEYS));
281
+
if (0 < \count($newQueueOptions = array_intersect(array_keys($queue), self::NEW_QUEUE_OPTIONS))) {
282
+
thrownewLogicException(sprintf('New "%s" and deprecated "%s" option(s) passed to the AMQP Messenger transport', implode('", "', $newQueueOptions), implode('", "', $deprecatedQueueOptions)));
283
+
}
284
+
}
285
+
286
+
if (0 < \count($invalidQueueOptions = array_diff(array_keys($queue), self::AVAILABLE_QUEUE_OPTIONS, self::NEW_QUEUE_OPTIONS, self::DEPRECATED_BINDING_KEYS))) {
265
287
trigger_deprecation('symfony/messenger', '5.1', 'Invalid queue option(s) "%s" passed to the AMQP Messenger transport. Passing invalid queue options is deprecated.', implode('", "', $invalidQueueOptions));
0 commit comments