@@ -2237,19 +2237,16 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
2237
2237
return $ this ->getNullsafeShortCircuitingType ($ node ->var , $ nativeType );
2238
2238
}
2239
2239
2240
- $ typeCallback = function () use ($ node ): Type {
2241
- $ returnType = $ this ->propertyFetchType (
2242
- $ this ->getType ($ node ->var ),
2243
- $ node ->name ->name ,
2244
- $ node ,
2245
- );
2246
- if ($ returnType === null ) {
2247
- return new ErrorType ();
2248
- }
2249
- return $ returnType ;
2250
- };
2240
+ $ returnType = $ this ->propertyFetchType (
2241
+ $ this ->getType ($ node ->var ),
2242
+ $ node ->name ->name ,
2243
+ $ node ,
2244
+ );
2245
+ if ($ returnType === null ) {
2246
+ $ returnType = new ErrorType ();
2247
+ }
2251
2248
2252
- return $ this ->getNullsafeShortCircuitingType ($ node ->var , $ typeCallback () );
2249
+ return $ this ->getNullsafeShortCircuitingType ($ node ->var , $ returnType );
2253
2250
}
2254
2251
2255
2252
$ nameType = $ this ->getType ($ node ->name );
@@ -2300,25 +2297,21 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
2300
2297
return $ nativeType ;
2301
2298
}
2302
2299
2303
- $ typeCallback = function () use ($ node ): Type {
2304
- if ($ node ->class instanceof Name) {
2305
- $ staticPropertyFetchedOnType = $ this ->resolveTypeByName ($ node ->class );
2306
- } else {
2307
- $ staticPropertyFetchedOnType = TypeCombinator::removeNull ($ this ->getType ($ node ->class ))->getObjectTypeOrClassStringObjectType ();
2308
- }
2300
+ if ($ node ->class instanceof Name) {
2301
+ $ staticPropertyFetchedOnType = $ this ->resolveTypeByName ($ node ->class );
2302
+ } else {
2303
+ $ staticPropertyFetchedOnType = TypeCombinator::removeNull ($ this ->getType ($ node ->class ))->getObjectTypeOrClassStringObjectType ();
2304
+ }
2309
2305
2310
- $ returnType = $ this ->propertyFetchType (
2311
- $ staticPropertyFetchedOnType ,
2312
- $ node ->name ->toString (),
2313
- $ node ,
2314
- );
2315
- if ($ returnType === null ) {
2316
- return new ErrorType ();
2317
- }
2318
- return $ returnType ;
2319
- };
2306
+ $ fetchType = $ this ->propertyFetchType (
2307
+ $ staticPropertyFetchedOnType ,
2308
+ $ node ->name ->toString (),
2309
+ $ node ,
2310
+ );
2311
+ if ($ fetchType === null ) {
2312
+ $ fetchType = new ErrorType ();
2313
+ }
2320
2314
2321
- $ fetchType = $ typeCallback ();
2322
2315
if ($ node ->class instanceof Expr) {
2323
2316
return $ this ->getNullsafeShortCircuitingType ($ node ->class , $ fetchType );
2324
2317
}
0 commit comments