File tree Expand file tree Collapse file tree 2 files changed +26
-20
lines changed Expand file tree Collapse file tree 2 files changed +26
-20
lines changed Original file line number Diff line number Diff line change @@ -366,16 +366,17 @@ abstract class BaseConnection implements ConnectionInterface
366
366
*/
367
367
public function __construct (array $ params )
368
368
{
369
+ if (isset ($ params ['dateFormat ' ])) {
370
+ $ this ->dateFormat = array_merge ($ this ->dateFormat , $ params ['dateFormat ' ]);
371
+ unset($ params ['dateFormat ' ]);
372
+ }
373
+
369
374
foreach ($ params as $ key => $ value ) {
370
375
if (property_exists ($ this , $ key )) {
371
376
$ this ->{$ key } = $ value ;
372
377
}
373
378
}
374
379
375
- if (isset ($ params ['dateFormat ' ])) {
376
- $ this ->dateFormat = array_merge ($ this ->dateFormat , $ params ['dateFormat ' ]);
377
- }
378
-
379
380
$ queryClass = str_replace ('Connection ' , 'Query ' , static ::class);
380
381
381
382
if (class_exists ($ queryClass )) {
Original file line number Diff line number Diff line change 26
26
final class BaseConnectionTest extends CIUnitTestCase
27
27
{
28
28
private array $ options = [
29
- 'DSN ' => '' ,
30
- 'hostname ' => 'localhost ' ,
31
- 'username ' => 'first ' ,
32
- 'password ' => 'last ' ,
33
- 'database ' => 'dbname ' ,
34
- 'DBDriver ' => 'MockDriver ' ,
35
- 'DBPrefix ' => 'test_ ' ,
36
- 'pConnect ' => true ,
37
- 'DBDebug ' => true ,
38
- 'charset ' => 'utf8mb4 ' ,
39
- 'DBCollat ' => 'utf8mb4_general_ci ' ,
40
- 'swapPre ' => '' ,
41
- 'encrypt ' => false ,
42
- 'compress ' => false ,
43
- 'strictOn ' => true ,
44
- 'failover ' => [],
29
+ 'DSN ' => '' ,
30
+ 'hostname ' => 'localhost ' ,
31
+ 'username ' => 'first ' ,
32
+ 'password ' => 'last ' ,
33
+ 'database ' => 'dbname ' ,
34
+ 'DBDriver ' => 'MockDriver ' ,
35
+ 'DBPrefix ' => 'test_ ' ,
36
+ 'pConnect ' => true ,
37
+ 'DBDebug ' => true ,
38
+ 'charset ' => 'utf8mb4 ' ,
39
+ 'DBCollat ' => 'utf8mb4_general_ci ' ,
40
+ 'swapPre ' => '' ,
41
+ 'encrypt ' => false ,
42
+ 'compress ' => false ,
43
+ 'strictOn ' => true ,
44
+ 'failover ' => [],
45
+ 'dateFormat ' => [
46
+ 'date ' => 'Y-m-d ' ,
47
+ 'datetime ' => 'Y-m-d H:i:s ' ,
48
+ 'time ' => 'H:i:s ' ,
49
+ ],
45
50
];
46
51
private array $ failoverOptions = [
47
52
'DSN ' => '' ,
You can’t perform that action at this time.
0 commit comments