File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ public function addConfiguration(ArrayNodeDefinition $builder)
42
42
->children ()
43
43
->scalarNode ('dsn ' )
44
44
->info ('The Mongodb DSN. Other parameters are ignored if set ' )
45
+ ->isRequired ()
45
46
->end ()
46
47
->scalarNode ('dbname ' )
47
48
->defaultValue ('enqueue ' )
@@ -64,12 +65,7 @@ public function addConfiguration(ArrayNodeDefinition $builder)
64
65
*/
65
66
public function createConnectionFactory (ContainerBuilder $ container , array $ config )
66
67
{
67
- if (false == empty ($ config ['dsn ' ])) {
68
- $ factory = new Definition (MongodbConnectionFactory::class);
69
- $ factory ->setArguments ([$ config ]);
70
- } else {
71
- throw new \LogicException ('Set "dsn" options when you want ot use Mongodb. ' );
72
- }
68
+ $ factory = new Definition (MongodbConnectionFactory::class, [$ config ]);
73
69
74
70
$ factoryId = sprintf ('enqueue.transport.%s.connection_factory ' , $ this ->getName ());
75
71
$ container ->setDefinition ($ factoryId , $ factory );
You can’t perform that action at this time.
0 commit comments