File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2360,6 +2360,7 @@ public function isSpecified(Expr $node): bool
23602360 {
23612361 $ exprString = $ this ->getNodeKey ($ node );
23622362
2363+ // TODO
23632364 return !$ node instanceof Variable && isset ($ this ->variableTypes [$ exprString ])
23642365 && $ this ->variableTypes [$ exprString ]->getCertainty ()->yes ();
23652366 }
@@ -2889,6 +2890,27 @@ private function enterAnonymousFunctionWithoutReflection(
28892890 $ nativeTypes [$ paramExprString ] = $ this ->getNativeType ($ use ->var );
28902891 }
28912892 $ variableTypes [$ paramExprString ] = VariableTypeHolder::createYes ($ variableType );
2893+
2894+ foreach ($ this ->variableTypes as $ exprString => $ typeHolder ) {
2895+ $ expr = $ this ->exprStringToExpr ((string ) $ exprString );
2896+ if ($ expr === null ) {
2897+ continue ;
2898+ }
2899+ if ($ expr instanceof Variable) {
2900+ continue ;
2901+ }
2902+ $ variable = (new NodeFinder ())->findFirst ([$ expr ], static fn (Node $ node ): bool => $ node instanceof Variable);
2903+ if (!$ variable instanceof Variable) {
2904+ continue ;
2905+ }
2906+ if (!is_string ($ variable ->name )) {
2907+ continue ;
2908+ }
2909+ if ($ variable ->name !== $ variableName ) {
2910+ continue ;
2911+ }
2912+ $ variableTypes [$ exprString ] = $ typeHolder ;
2913+ }
28922914 }
28932915
28942916 if ($ this ->hasVariableType ('this ' )->yes () && !$ closure ->static ) {
You can’t perform that action at this time.
0 commit comments