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(
39
39
$ isFalseType = (new ConstantBooleanType (false ))->isSuperTypeOf ($ firstArgType );
40
40
$ compareTypes = $ isTrueType ->compareTo ($ isFalseType );
41
41
42
- $ defaultArgType = isset ($ methodCall ->args [1 ]) ? $ scope ->getType ($ methodCall ->args [1 ]->value ) : new NullType ();
43
-
44
42
if ($ compareTypes === $ isTrueType ) {
43
+ $ defaultArgType = isset ($ methodCall ->args [1 ]) ? $ scope ->getType ($ methodCall ->args [1 ]->value ) : new NullType ();
44
+
45
45
return TypeCombinator::union ($ defaultArgType , new StringType ());
46
46
}
47
47
if ($ compareTypes === $ isFalseType ) {
48
- return TypeCombinator:: union ( $ defaultArgType , new ArrayType (new IntegerType (), new StringType () ));
48
+ return new ArrayType (new IntegerType (), new StringType ());
49
49
}
50
50
51
51
return ParametersAcceptorSelector::selectSingle ($ methodReflection ->getVariants ())->getReturnType ();
Original file line number Diff line number Diff line change @@ -25,13 +25,10 @@ public function getProvider(): Iterator
25
25
yield ['$test1 ' , 'string|null ' ];
26
26
yield ['$test2 ' , 'string|null ' ];
27
27
yield ['$test3 ' , 'string ' ];
28
- yield ['$test4 ' , 'array<int, string>|string ' ];
29
28
yield ['$test5 ' , 'string|null ' ];
30
29
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> ' ];
35
32
}
36
33
37
34
}
Original file line number Diff line number Diff line change 5
5
$ test1 = $ bag ->get ('foo ' );
6
6
$ test2 = $ bag ->get ('foo ' , null );
7
7
$ test3 = $ bag ->get ('foo ' , 'baz ' );
8
- $ test4 = $ bag ->get ('foo ' , ['baz ' ]);
9
8
10
9
$ test5 = $ bag ->get ('foo ' , null , true );
11
10
$ test6 = $ bag ->get ('foo ' , 'baz ' , true );
12
- $ test7 = $ bag ->get ('foo ' , ['baz ' ], true );
13
11
14
12
$ test8 = $ bag ->get ('foo ' , null , false );
15
13
$ test9 = $ bag ->get ('foo ' , 'baz ' , false );
16
- $ test10 = $ bag ->get ('foo ' , ['baz ' ], false );
17
14
18
15
die;
You can’t perform that action at this time.
0 commit comments