@@ -65,14 +65,13 @@ public function __construct($config = 'redis:')
6565 }
6666
6767 $ this ->config = array_replace ($ this ->defaultConfig (), $ config );
68- $ vendor = $ this ->config ['vendor ' ];
6968
7069 $ supportedVendors = ['predis ' , 'phpredis ' , 'custom ' ];
71- if (false == in_array ($ vendor , $ supportedVendors , true )) {
70+ if (false == in_array ($ this -> config [ ' vendor ' ] , $ supportedVendors , true )) {
7271 throw new \LogicException (sprintf (
7372 'Unsupported redis vendor given. It must be either "%s". Got "%s" ' ,
7473 implode ('", " ' , $ supportedVendors ),
75- $ vendor
74+ $ this -> config [ ' vendor ' ]
7675 ));
7776 }
7877 }
@@ -122,10 +121,8 @@ private function createRedis(): Redis
122121
123122 private function parseDsn (string $ dsn ): array
124123 {
125- $ unsupportedError = 'The given DSN "%s" is not supported. Must start with "redis:". ' ;
126-
127124 if ((false === strpos ($ dsn , 'redis: ' )) and (false === strpos ($ dsn , 'rediss: ' ))) {
128- throw new \LogicException (sprintf ($ unsupportedError , $ dsn ));
125+ throw new \LogicException (sprintf (' The given DSN "%s" is not supported. Must start with "redis:" or "rediss:". ' , $ dsn ));
129126 }
130127
131128 if (false === $ config = parse_url ($ dsn )) {
@@ -143,18 +140,6 @@ private function parseDsn(string $dsn): array
143140 $ config = array_replace ($ queryConfig , $ config );
144141 }
145142
146- if (isset ($ config ['vendor ' ])) {
147- $ vendor = $ config ['vendor ' ];
148- } else {
149- $ vendor = "" ;
150- }
151-
152-
153- //predis additionaly supports tls as scheme, but it must remain in the $config array
154- if ($ vendor !='predis ' ) {
155- if ($ config ['scheme ' ]!='redis ' ) throw new \LogicException (sprintf ($ unsupportedError , $ dsn ));
156- unset($ config ['scheme ' ]);
157- }
158143 unset($ config ['query ' ]);
159144
160145 $ config ['lazy ' ] = empty ($ config ['lazy ' ]) ? false : true ;
0 commit comments