@@ -5628,13 +5628,17 @@ static function (): void {
5628
5628
$ assignedNativeType = $ scope ->getNativeType ($ assignedExpr );
5629
5629
$ propertyNativeType = $ propertyReflection ->getNativeType ();
5630
5630
5631
- if ($ propertyReflection ->hasNativeType () && $ propertyNativeType ->isNull ()->no ()) {
5632
- $ assignedExprType = TypeCombinator::removeNull ($ assignedExprType );
5633
- $ assignedNativeType = TypeCombinator::removeNull ($ assignedNativeType );
5634
- }
5631
+ if ($ propertyReflection ->hasNativeType ()) {
5632
+ if ($ propertyNativeType ->isNull ()->no ()) {
5633
+ $ assignedExprType = TypeCombinator::removeNull ($ assignedExprType );
5634
+ $ assignedNativeType = TypeCombinator::removeNull ($ assignedNativeType );
5635
+ }
5635
5636
5636
- if ($ propertyReflection ->hasNativeType () && $ scope ->isDeclareStrictTypes ()) {
5637
- $ scope = $ scope ->assignExpression ($ var , TypeCombinator::intersect ($ assignedExprType ->toCoercedArgumentType (true ), $ propertyNativeType ), TypeCombinator::intersect ($ assignedNativeType ->toCoercedArgumentType (true ), $ propertyNativeType ));
5637
+ if ($ scope ->isDeclareStrictTypes ()) {
5638
+ $ scope = $ scope ->assignExpression ($ var , TypeCombinator::intersect ($ assignedExprType ->toCoercedArgumentType (true ), $ propertyNativeType ), TypeCombinator::intersect ($ assignedNativeType ->toCoercedArgumentType (true ), $ propertyNativeType ));
5639
+ } else {
5640
+ $ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ assignedNativeType );
5641
+ }
5638
5642
} else {
5639
5643
$ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ assignedNativeType );
5640
5644
}
@@ -5705,13 +5709,17 @@ static function (): void {
5705
5709
$ assignedNativeType = $ scope ->getNativeType ($ assignedExpr );
5706
5710
$ propertyNativeType = $ propertyReflection ->getNativeType ();
5707
5711
5708
- if ($ propertyReflection ->hasNativeType () && $ propertyNativeType ->isNull ()->no ()) {
5709
- $ assignedExprType = TypeCombinator::removeNull ($ assignedExprType );
5710
- $ assignedNativeType = TypeCombinator::removeNull ($ assignedNativeType );
5711
- }
5712
+ if ($ propertyReflection ->hasNativeType ()) {
5713
+ if ($ propertyNativeType ->isNull ()->no ()) {
5714
+ $ assignedExprType = TypeCombinator::removeNull ($ assignedExprType );
5715
+ $ assignedNativeType = TypeCombinator::removeNull ($ assignedNativeType );
5716
+ }
5712
5717
5713
- if ($ propertyReflection ->hasNativeType () && $ scope ->isDeclareStrictTypes ()) {
5714
- $ scope = $ scope ->assignExpression ($ var , TypeCombinator::intersect ($ assignedExprType ->toCoercedArgumentType (true ), $ propertyNativeType ), TypeCombinator::intersect ($ assignedNativeType ->toCoercedArgumentType (true ), $ propertyNativeType ));
5718
+ if ($ scope ->isDeclareStrictTypes ()) {
5719
+ $ scope = $ scope ->assignExpression ($ var , TypeCombinator::intersect ($ assignedExprType ->toCoercedArgumentType (true ), $ propertyNativeType ), TypeCombinator::intersect ($ assignedNativeType ->toCoercedArgumentType (true ), $ propertyNativeType ));
5720
+ } else {
5721
+ $ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ assignedNativeType );
5722
+ }
5715
5723
} else {
5716
5724
$ scope = $ scope ->assignExpression ($ var , $ assignedExprType , $ assignedNativeType );
5717
5725
}
0 commit comments