File tree 1 file changed +22
-19
lines changed
1 file changed +22
-19
lines changed Original file line number Diff line number Diff line change @@ -474,31 +474,34 @@ public function loadFromSQL(string $sql, array $input = []) : bool
474
474
// cast to correct values as ints, floats, etc are read in from PDO as strings
475
475
foreach (static ::$ fields as $ field => $ row )
476
476
{
477
- switch ( $ row [ 1 ])
477
+ if ( null !== $ this -> current [ $ field ]) // @phpstan-ignore-line
478
478
{
479
- case 'int ' :
480
- if (\array_key_exists ($ field , $ this ->current ))
481
- {
482
- $ this ->current [$ field ] = (int )$ this ->current [$ field ];
483
- }
479
+ switch ($ row [1 ])
480
+ {
481
+ case 'int ' :
482
+ if (\array_key_exists ($ field , $ this ->current ))
483
+ {
484
+ $ this ->current [$ field ] = (int )$ this ->current [$ field ];
485
+ }
484
486
485
- break ;
487
+ break ;
486
488
487
- case 'float ' :
488
- if (\array_key_exists ($ field , $ this ->current ))
489
- {
490
- $ this ->current [$ field ] = (float )$ this ->current [$ field ];
491
- }
489
+ case 'float ' :
490
+ if (\array_key_exists ($ field , $ this ->current ))
491
+ {
492
+ $ this ->current [$ field ] = (float )$ this ->current [$ field ];
493
+ }
492
494
493
- break ;
495
+ break ;
494
496
495
- case 'bool ' :
496
- if (\array_key_exists ($ field , $ this ->current ))
497
- {
498
- $ this ->current [$ field ] = (bool )$ this ->current [$ field ];
499
- }
497
+ case 'bool ' :
498
+ if (\array_key_exists ($ field , $ this ->current ))
499
+ {
500
+ $ this ->current [$ field ] = (bool )$ this ->current [$ field ];
501
+ }
500
502
501
- break ;
503
+ break ;
504
+ }
502
505
}
503
506
}
504
507
You can’t perform that action at this time.
0 commit comments