@@ -302,30 +302,6 @@ protected function compileBinds()
302
302
}
303
303
}
304
304
305
- /**
306
- * Match bindings
307
- */
308
- protected function matchNamedBinds (string $ sql , array $ binds ): string
309
- {
310
- $ replacers = [];
311
-
312
- foreach ($ binds as $ placeholder => $ value ) {
313
- // $value[1] contains the boolean whether should be escaped or not
314
- $ escapedValue = $ value [1 ] ? $ this ->db ->escape ($ value [0 ]) : $ value [0 ];
315
-
316
- // In order to correctly handle backlashes in saved strings
317
- // we will need to preg_quote, so remove the wrapping escape characters
318
- // otherwise it will get escaped.
319
- if (is_array ($ value [0 ])) {
320
- $ escapedValue = '( ' . implode (', ' , $ escapedValue ) . ') ' ;
321
- }
322
-
323
- $ replacers [": {$ placeholder }: " ] = $ escapedValue ;
324
- }
325
-
326
- return strtr ($ sql , $ replacers );
327
- }
328
-
329
305
/**
330
306
* Match bindings
331
307
*/
@@ -356,6 +332,30 @@ protected function matchSimpleBinds(string $sql, array $binds, int $bindCount, i
356
332
return $ sql ;
357
333
}
358
334
335
+ /**
336
+ * Match bindings
337
+ */
338
+ protected function matchNamedBinds (string $ sql , array $ binds ): string
339
+ {
340
+ $ replacers = [];
341
+
342
+ foreach ($ binds as $ placeholder => $ value ) {
343
+ // $value[1] contains the boolean whether should be escaped or not
344
+ $ escapedValue = $ value [1 ] ? $ this ->db ->escape ($ value [0 ]) : $ value [0 ];
345
+
346
+ // In order to correctly handle backlashes in saved strings
347
+ // we will need to preg_quote, so remove the wrapping escape characters
348
+ // otherwise it will get escaped.
349
+ if (is_array ($ value [0 ])) {
350
+ $ escapedValue = '( ' . implode (', ' , $ escapedValue ) . ') ' ;
351
+ }
352
+
353
+ $ replacers [": {$ placeholder }: " ] = $ escapedValue ;
354
+ }
355
+
356
+ return strtr ($ sql , $ replacers );
357
+ }
358
+
359
359
/**
360
360
* Returns string to display in debug toolbar
361
361
*/
0 commit comments