@@ -376,7 +376,7 @@ public function walkFunction($function): string
376
376
new FloatType ()
377
377
);
378
378
379
- if (TypeCombinator:: containsNull ($ exprType )) {
379
+ if ($ this -> canBeNull ($ exprType )) {
380
380
$ type = TypeCombinator::addNull ($ type );
381
381
}
382
382
@@ -388,7 +388,7 @@ public function walkFunction($function): string
388
388
$ secondExprType = $ this ->unmarshalType ($ function ->secondArithmetic ->dispatch ($ this ));
389
389
390
390
$ type = IntegerRangeType::fromInterval (0 , null );
391
- if (TypeCombinator:: containsNull ($ firstExprType ) || TypeCombinator:: containsNull ($ secondExprType )) {
391
+ if ($ this -> canBeNull ($ firstExprType ) || $ this -> canBeNull ($ secondExprType )) {
392
392
$ type = TypeCombinator::addNull ($ type );
393
393
}
394
394
@@ -399,7 +399,7 @@ public function walkFunction($function): string
399
399
400
400
foreach ($ function ->concatExpressions as $ expr ) {
401
401
$ type = $ this ->unmarshalType ($ expr ->dispatch ($ this ));
402
- $ hasNull = $ hasNull || TypeCombinator:: containsNull ($ type );
402
+ $ hasNull = $ hasNull || $ this -> canBeNull ($ type );
403
403
}
404
404
405
405
$ type = new StringType ();
@@ -420,7 +420,7 @@ public function walkFunction($function): string
420
420
$ intervalExprType = $ this ->unmarshalType ($ function ->intervalExpression ->dispatch ($ this ));
421
421
422
422
$ type = new StringType ();
423
- if (TypeCombinator:: containsNull ($ dateExprType ) || TypeCombinator:: containsNull ($ intervalExprType )) {
423
+ if ($ this -> canBeNull ($ dateExprType ) || $ this -> canBeNull ($ intervalExprType )) {
424
424
$ type = TypeCombinator::addNull ($ type );
425
425
}
426
426
@@ -434,7 +434,7 @@ public function walkFunction($function): string
434
434
new IntegerType (),
435
435
new FloatType ()
436
436
);
437
- if (TypeCombinator:: containsNull ($ date1ExprType ) || TypeCombinator:: containsNull ($ date2ExprType )) {
437
+ if ($ this -> canBeNull ($ date1ExprType ) || $ this -> canBeNull ($ date2ExprType )) {
438
438
$ type = TypeCombinator::addNull ($ type );
439
439
}
440
440
@@ -444,7 +444,7 @@ public function walkFunction($function): string
444
444
$ stringPrimaryType = $ this ->unmarshalType ($ function ->stringPrimary ->dispatch ($ this ));
445
445
446
446
$ type = IntegerRangeType::fromInterval (0 , null );
447
- if (TypeCombinator:: containsNull ($ stringPrimaryType )) {
447
+ if ($ this -> canBeNull ($ stringPrimaryType )) {
448
448
$ type = TypeCombinator::addNull ($ type );
449
449
}
450
450
@@ -455,7 +455,7 @@ public function walkFunction($function): string
455
455
$ secondExprType = $ this ->unmarshalType ($ this ->walkStringPrimary ($ function ->secondStringPrimary ));
456
456
457
457
$ type = IntegerRangeType::fromInterval (0 , null );
458
- if (TypeCombinator:: containsNull ($ firstExprType ) || TypeCombinator:: containsNull ($ secondExprType )) {
458
+ if ($ this -> canBeNull ($ firstExprType ) || $ this -> canBeNull ($ secondExprType )) {
459
459
$ type = TypeCombinator::addNull ($ type );
460
460
}
461
461
@@ -467,7 +467,7 @@ public function walkFunction($function): string
467
467
$ stringPrimaryType = $ this ->unmarshalType ($ function ->stringPrimary ->dispatch ($ this ));
468
468
469
469
$ type = new StringType ();
470
- if (TypeCombinator:: containsNull ($ stringPrimaryType )) {
470
+ if ($ this -> canBeNull ($ stringPrimaryType )) {
471
471
$ type = TypeCombinator::addNull ($ type );
472
472
}
473
473
@@ -478,7 +478,7 @@ public function walkFunction($function): string
478
478
$ secondExprType = $ this ->unmarshalType ($ this ->walkSimpleArithmeticExpression ($ function ->secondSimpleArithmeticExpression ));
479
479
480
480
$ type = IntegerRangeType::fromInterval (0 , null );
481
- if (TypeCombinator:: containsNull ($ firstExprType ) || TypeCombinator:: containsNull ($ secondExprType )) {
481
+ if ($ this -> canBeNull ($ firstExprType ) || $ this -> canBeNull ($ secondExprType )) {
482
482
$ type = TypeCombinator::addNull ($ type );
483
483
}
484
484
@@ -493,7 +493,7 @@ public function walkFunction($function): string
493
493
$ exprType = $ this ->unmarshalType ($ this ->walkSimpleArithmeticExpression ($ function ->simpleArithmeticExpression ));
494
494
495
495
$ type = new FloatType ();
496
- if (TypeCombinator:: containsNull ($ exprType )) {
496
+ if ($ this -> canBeNull ($ exprType )) {
497
497
$ type = TypeCombinator::addNull ($ type );
498
498
}
499
499
@@ -510,7 +510,7 @@ public function walkFunction($function): string
510
510
}
511
511
512
512
$ type = new StringType ();
513
- if (TypeCombinator:: containsNull ($ stringType ) || TypeCombinator:: containsNull ($ firstExprType ) || TypeCombinator:: containsNull ($ secondExprType )) {
513
+ if ($ this -> canBeNull ($ stringType ) || $ this -> canBeNull ($ firstExprType ) || $ this -> canBeNull ($ secondExprType )) {
514
514
$ type = TypeCombinator::addNull ($ type );
515
515
}
516
516
@@ -714,7 +714,7 @@ public function walkCoalesceExpression($coalesceExpression): string
714
714
}
715
715
716
716
$ type = $ this ->unmarshalType ($ expression ->dispatch ($ this ));
717
- $ allTypesContainNull = $ allTypesContainNull && TypeCombinator:: containsNull ($ type );
717
+ $ allTypesContainNull = $ allTypesContainNull && $ this -> canBeNull ($ type );
718
718
719
719
// Some drivers manipulate the types, lets avoid false positives by generalizing constant types
720
720
// e.g. sqlsrv: "COALESCE returns the data type of value with the highest precedence"
0 commit comments