@@ -65,14 +65,13 @@ public function __construct($config = 'redis:')
65
65
}
66
66
67
67
$ this ->config = array_replace ($ this ->defaultConfig (), $ config );
68
- $ vendor = $ this ->config ['vendor ' ];
69
68
70
69
$ supportedVendors = ['predis ' , 'phpredis ' , 'custom ' ];
71
- if (false == in_array ($ vendor , $ supportedVendors , true )) {
70
+ if (false == in_array ($ this -> config [ ' vendor ' ] , $ supportedVendors , true )) {
72
71
throw new \LogicException (sprintf (
73
72
'Unsupported redis vendor given. It must be either "%s". Got "%s" ' ,
74
73
implode ('", " ' , $ supportedVendors ),
75
- $ vendor
74
+ $ this -> config [ ' vendor ' ]
76
75
));
77
76
}
78
77
}
@@ -122,10 +121,8 @@ private function createRedis(): Redis
122
121
123
122
private function parseDsn (string $ dsn ): array
124
123
{
125
- $ unsupportedError = 'The given DSN "%s" is not supported. Must start with "redis:". ' ;
126
-
127
124
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 ));
129
126
}
130
127
131
128
if (false === $ config = parse_url ($ dsn )) {
@@ -143,18 +140,6 @@ private function parseDsn(string $dsn): array
143
140
$ config = array_replace ($ queryConfig , $ config );
144
141
}
145
142
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
- }
158
143
unset($ config ['query ' ]);
159
144
160
145
$ config ['lazy ' ] = empty ($ config ['lazy ' ]) ? false : true ;
0 commit comments