File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -39,18 +39,17 @@ public function __construct($config = 'sqs:')
3939 {
4040 if (empty ($ config ) || 'sqs: ' === $ config ) {
4141 $ config = [];
42- }
43-
44- if (is_string ($ config )) {
42+ } elseif (is_string ($ config )) {
4543 $ config = $ this ->parseDsn ($ config );
46- }
44+ } elseif (is_array ($ config )) {
45+ $ dsn = array_key_exists ('dsn ' , $ config ) ? $ config ['dsn ' ] : null ;
46+ unset($ config ['dsn ' ]);
4747
48- if (!is_array ($ config )) {
49- throw new \LogicException ('The config must be either an array of options, a DSN string, or null ' );
50- }
51-
52- if (count ($ config ) == 1 && array_key_exists ('dsn ' , $ config )) {
53- $ config = $ this ->parseDsn ($ config ['dsn ' ]);
48+ if ($ dsn ) {
49+ $ config = array_replace ($ config , $ this ->parseDsn ($ dsn ));
50+ }
51+ } else {
52+ throw new \LogicException ('The config must be either an array of options, a DSN string or null ' );
5453 }
5554
5655 $ this ->config = array_replace ($ this ->defaultConfig (), $ config );
You can’t perform that action at this time.
0 commit comments