@@ -2166,19 +2166,16 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
2166
2166
return $ this ->getNullsafeShortCircuitingType ($ node ->var , $ nativeType );
2167
2167
}
2168
2168
2169
- $ typeCallback = function () use ($ node ): Type {
2170
- $ returnType = $ this ->propertyFetchType (
2171
- $ this ->getType ($ node ->var ),
2172
- $ node ->name ->name ,
2173
- $ node ,
2174
- );
2175
- if ($ returnType === null ) {
2176
- return new ErrorType ();
2177
- }
2178
- return $ returnType ;
2179
- };
2169
+ $ returnType = $ this ->propertyFetchType (
2170
+ $ this ->getType ($ node ->var ),
2171
+ $ node ->name ->name ,
2172
+ $ node ,
2173
+ );
2174
+ if ($ returnType === null ) {
2175
+ $ returnType = new ErrorType ();
2176
+ }
2180
2177
2181
- return $ this ->getNullsafeShortCircuitingType ($ node ->var , $ typeCallback () );
2178
+ return $ this ->getNullsafeShortCircuitingType ($ node ->var , $ returnType );
2182
2179
}
2183
2180
2184
2181
$ nameType = $ this ->getType ($ node ->name );
@@ -2229,25 +2226,21 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
2229
2226
return $ nativeType ;
2230
2227
}
2231
2228
2232
- $ typeCallback = function () use ($ node ): Type {
2233
- if ($ node ->class instanceof Name) {
2234
- $ staticPropertyFetchedOnType = $ this ->resolveTypeByName ($ node ->class );
2235
- } else {
2236
- $ staticPropertyFetchedOnType = TypeCombinator::removeNull ($ this ->getType ($ node ->class ))->getObjectTypeOrClassStringObjectType ();
2237
- }
2229
+ if ($ node ->class instanceof Name) {
2230
+ $ staticPropertyFetchedOnType = $ this ->resolveTypeByName ($ node ->class );
2231
+ } else {
2232
+ $ staticPropertyFetchedOnType = TypeCombinator::removeNull ($ this ->getType ($ node ->class ))->getObjectTypeOrClassStringObjectType ();
2233
+ }
2238
2234
2239
- $ returnType = $ this ->propertyFetchType (
2240
- $ staticPropertyFetchedOnType ,
2241
- $ node ->name ->toString (),
2242
- $ node ,
2243
- );
2244
- if ($ returnType === null ) {
2245
- return new ErrorType ();
2246
- }
2247
- return $ returnType ;
2248
- };
2235
+ $ fetchType = $ this ->propertyFetchType (
2236
+ $ staticPropertyFetchedOnType ,
2237
+ $ node ->name ->toString (),
2238
+ $ node ,
2239
+ );
2240
+ if ($ fetchType === null ) {
2241
+ $ fetchType = new ErrorType ();
2242
+ }
2249
2243
2250
- $ fetchType = $ typeCallback ();
2251
2244
if ($ node ->class instanceof Expr) {
2252
2245
return $ this ->getNullsafeShortCircuitingType ($ node ->class , $ fetchType );
2253
2246
}
0 commit comments