File tree Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -39,13 +39,13 @@ public function getTypeFromMethodCall(
3939 $ isFalseType = (new ConstantBooleanType (false ))->isSuperTypeOf ($ firstArgType );
4040 $ compareTypes = $ isTrueType ->compareTo ($ isFalseType );
4141
42- $ defaultArgType = isset ($ methodCall ->args [1 ]) ? $ scope ->getType ($ methodCall ->args [1 ]->value ) : new NullType ();
43-
4442 if ($ compareTypes === $ isTrueType ) {
43+ $ defaultArgType = isset ($ methodCall ->args [1 ]) ? $ scope ->getType ($ methodCall ->args [1 ]->value ) : new NullType ();
44+
4545 return TypeCombinator::union ($ defaultArgType , new StringType ());
4646 }
4747 if ($ compareTypes === $ isFalseType ) {
48- return TypeCombinator:: union ( $ defaultArgType , new ArrayType (new IntegerType (), new StringType () ));
48+ return new ArrayType (new IntegerType (), new StringType ());
4949 }
5050
5151 return ParametersAcceptorSelector::selectSingle ($ methodReflection ->getVariants ())->getReturnType ();
Original file line number Diff line number Diff line change @@ -25,13 +25,10 @@ public function getProvider(): Iterator
2525 yield ['$test1 ' , 'string|null ' ];
2626 yield ['$test2 ' , 'string|null ' ];
2727 yield ['$test3 ' , 'string ' ];
28- yield ['$test4 ' , 'array<int, string>|string ' ];
2928 yield ['$test5 ' , 'string|null ' ];
3029 yield ['$test6 ' , 'string ' ];
31- yield ['$test7 ' , 'array<int, string>|string ' ];
32- yield ['$test8 ' , 'array<int, string>|null ' ];
33- yield ['$test9 ' , 'array<int, string>|string ' ];
34- yield ['$test10 ' , 'array<int, string> ' ];
30+ yield ['$test8 ' , 'array<int, string> ' ];
31+ yield ['$test9 ' , 'array<int, string> ' ];
3532 }
3633
3734}
Original file line number Diff line number Diff line change 55$ test1 = $ bag ->get ('foo ' );
66$ test2 = $ bag ->get ('foo ' , null );
77$ test3 = $ bag ->get ('foo ' , 'baz ' );
8- $ test4 = $ bag ->get ('foo ' , ['baz ' ]);
98
109$ test5 = $ bag ->get ('foo ' , null , true );
1110$ test6 = $ bag ->get ('foo ' , 'baz ' , true );
12- $ test7 = $ bag ->get ('foo ' , ['baz ' ], true );
1311
1412$ test8 = $ bag ->get ('foo ' , null , false );
1513$ test9 = $ bag ->get ('foo ' , 'baz ' , false );
16- $ test10 = $ bag ->get ('foo ' , ['baz ' ], false );
1714
1815die;
You can’t perform that action at this time.
0 commit comments