@@ -36,7 +36,7 @@ trait FakePdoStatementTrait
36
36
private $ fetchConstructorArgs = null ;
37
37
38
38
/**
39
- * @var FakePdo
39
+ * @var FakePdoInterface
40
40
*/
41
41
private $ conn ;
42
42
@@ -55,7 +55,7 @@ trait FakePdoStatementTrait
55
55
*/
56
56
private $ boundValues = [];
57
57
58
- public function __construct (FakePdo $ conn , string $ sql , ?\PDO $ real )
58
+ public function __construct (FakePdoInterface $ conn , string $ sql , ?\PDO $ real )
59
59
{
60
60
$ this ->sql = $ sql ;
61
61
$ this ->conn = $ conn ;
@@ -158,7 +158,7 @@ public function universalExecute(?array $params = null)
158
158
$ real_result = $ this ->realStatement ->fetchAll (\PDO ::FETCH_ASSOC );
159
159
160
160
if ($ fake_result ) {
161
- if ($ this ->conn ->stringifyResult ) {
161
+ if ($ this ->conn ->shouldStringifyResult () ) {
162
162
$ fake_result = array_map (
163
163
function ($ row ) {
164
164
return self ::stringify ($ row );
@@ -167,7 +167,7 @@ function ($row) {
167
167
);
168
168
}
169
169
170
- if ($ this ->conn ->lowercaseResultKeys ) {
170
+ if ($ this ->conn ->shouldLowercaseResultKeys () ) {
171
171
$ fake_result = array_map (
172
172
function ($ row ) {
173
173
return self ::lowercaseKeys ($ row );
@@ -214,23 +214,23 @@ function ($row) {
214
214
215
215
case Query \TruncateQuery::class:
216
216
$ this ->conn ->getServer ()->resetTable (
217
- $ this ->conn ->databaseName ,
217
+ $ this ->conn ->getDatabaseName () ,
218
218
$ parsed_query ->table
219
219
);
220
220
221
221
break ;
222
222
223
223
case Query \DropTableQuery::class:
224
224
$ this ->conn ->getServer ()->dropTable (
225
- $ this ->conn ->databaseName ,
225
+ $ this ->conn ->getDatabaseName () ,
226
226
$ parsed_query ->table
227
227
);
228
228
229
229
break ;
230
230
231
231
case Query \ShowTablesQuery::class:
232
232
if ($ this ->conn ->getServer ()->getTable (
233
- $ this ->conn ->databaseName ,
233
+ $ this ->conn ->getDatabaseName () ,
234
234
$ parsed_query ->pattern
235
235
)) {
236
236
$ this ->result = [[$ parsed_query ->sql => $ parsed_query ->pattern ]];
@@ -302,11 +302,11 @@ public function fetch(
302
302
return false ;
303
303
}
304
304
305
- if ($ this ->conn ->stringifyResult ) {
305
+ if ($ this ->conn ->shouldStringifyResult () ) {
306
306
$ row = self ::stringify ($ row );
307
307
}
308
308
309
- if ($ this ->conn ->lowercaseResultKeys ) {
309
+ if ($ this ->conn ->shouldLowercaseResultKeys () ) {
310
310
$ row = self ::lowercaseKeys ($ row );
311
311
}
312
312
@@ -355,11 +355,11 @@ public function universalFetchAll(int $fetch_style = -123, ...$args) : array
355
355
if ($ fetch_style === \PDO ::FETCH_ASSOC ) {
356
356
return array_map (
357
357
function ($ row ) {
358
- if ($ this ->conn ->stringifyResult ) {
358
+ if ($ this ->conn ->shouldStringifyResult () ) {
359
359
$ row = self ::stringify ($ row );
360
360
}
361
361
362
- if ($ this ->conn ->lowercaseResultKeys ) {
362
+ if ($ this ->conn ->shouldLowercaseResultKeys () ) {
363
363
$ row = self ::lowercaseKeys ($ row );
364
364
}
365
365
@@ -374,7 +374,7 @@ function ($row) {
374
374
if ($ fetch_style === \PDO ::FETCH_NUM ) {
375
375
return array_map (
376
376
function ($ row ) {
377
- if ($ this ->conn ->stringifyResult ) {
377
+ if ($ this ->conn ->shouldStringifyResult () ) {
378
378
$ row = self ::stringify ($ row );
379
379
}
380
380
@@ -387,11 +387,11 @@ function ($row) {
387
387
if ($ fetch_style === \PDO ::FETCH_BOTH ) {
388
388
return array_map (
389
389
function ($ row ) {
390
- if ($ this ->conn ->stringifyResult ) {
390
+ if ($ this ->conn ->shouldStringifyResult () ) {
391
391
$ row = self ::stringify ($ row );
392
392
}
393
393
394
- if ($ this ->conn ->lowercaseResultKeys ) {
394
+ if ($ this ->conn ->shouldLowercaseResultKeys () ) {
395
395
$ row = self ::lowercaseKeys ($ row );
396
396
}
397
397
@@ -405,7 +405,7 @@ function ($row) {
405
405
return \array_column (
406
406
array_map (
407
407
function ($ row ) {
408
- if ($ this ->conn ->stringifyResult ) {
408
+ if ($ this ->conn ->shouldStringifyResult () ) {
409
409
$ row = self ::stringify ($ row );
410
410
}
411
411
@@ -424,11 +424,11 @@ function ($row) {
424
424
425
425
return array_map (
426
426
function ($ row ) use ($ fetch_argument , $ ctor_args ) {
427
- if ($ this ->conn ->stringifyResult ) {
427
+ if ($ this ->conn ->shouldStringifyResult () ) {
428
428
$ row = self ::stringify ($ row );
429
429
}
430
430
431
- if ($ this ->conn ->lowercaseResultKeys ) {
431
+ if ($ this ->conn ->shouldLowercaseResultKeys () ) {
432
432
$ row = self ::lowercaseKeys ($ row );
433
433
}
434
434
0 commit comments