@@ -70,13 +70,6 @@ public function findSpecifiedType(
70
70
}
71
71
$ args = $ node ->getArgs ();
72
72
$ argsCount = count ($ args );
73
-
74
- foreach ($ args as $ arg ) {
75
- if ($ arg ->value instanceof Expr \Assign) {
76
- return null ;
77
- }
78
- }
79
-
80
73
if ($ node ->name instanceof Node \Name) {
81
74
$ functionName = strtolower ((string ) $ node ->name );
82
75
if ($ functionName === 'assert ' && $ argsCount >= 1 ) {
@@ -286,6 +279,16 @@ public function findSpecifiedType(
286
279
287
280
$ results = [];
288
281
282
+ $ assignedInCallVars = [];
283
+ if ($ node instanceof Expr \CallLike) {
284
+ foreach ($ node ->getArgs () as $ arg ) {
285
+ if (!$ arg ->value instanceof Expr \Assign) {
286
+ continue ;
287
+ }
288
+
289
+ $ assignedInCallVars [] = $ arg ->value ;
290
+ }
291
+ }
289
292
foreach ($ sureTypes as $ sureType ) {
290
293
if (self ::isSpecified ($ typeSpecifierScope , $ node , $ sureType [0 ])) {
291
294
$ results [] = TrinaryLogic::createMaybe ();
@@ -301,6 +304,14 @@ public function findSpecifiedType(
301
304
/** @var Type $resultType */
302
305
$ resultType = $ sureType [1 ];
303
306
307
+ foreach ($ assignedInCallVars as $ assignedInCallVar ) {
308
+ if ($ sureType [0 ] !== $ assignedInCallVar ->var ) {
309
+ continue ;
310
+ }
311
+
312
+ $ argumentType = $ scope ->getType ($ assignedInCallVar ->expr );
313
+ }
314
+
304
315
$ results [] = $ resultType ->isSuperTypeOf ($ argumentType )->result ;
305
316
}
306
317
0 commit comments