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
{{ message }}
Repository navigation
Commit 031380e
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -59,8 +50,19 @@ public function addConfiguration(ArrayNodeDefinition $builder)
59
50
})
60
51
->end()
61
52
->children()
62
-
->enumNode('driver')
63
-
->values($drivers)
53
+
->scalarNode('driver')
54
+
->validate()
55
+
->always(function ($v) use ($transportsMap) {
56
+
$drivers = array_keys($transportsMap);
57
+
if (empty($transportsMap)) {
58
+
thrownew \InvalidArgumentException('There is no amqp driver available. Please consider installing one of the packages: enqueue/amqp-ext, enqueue/amqp-lib, enqueue/amqp-bunny.');
59
+
}
60
+
61
+
if (isset($v['driver']) && false == in_array($v['driver'], $drivers, true)) {
62
+
thrownew \InvalidArgumentException(sprintf('Unexpected driver given "invalidDriver". Available are "%s"', implode('", "', $drivers)));
63
+
}
64
+
})
65
+
->end()
64
66
->end()
65
67
->scalarNode('dsn')
66
68
->info('The connection to AMQP broker set as a string. Other parameters could be used as defaults')
if (false == array_key_exists($config['driver'], $transportsMap)) {
209
+
thrownew \InvalidArgumentException(sprintf('Unexpected driver given "invalidDriver". Available are "%s"', implode('", "', array_keys($transportsMap))));
212
210
}
213
211
214
-
thrownew \LogicException(sprintf('Unexpected driver given "%s"', $config['driver']));
0 commit comments