Skip to content

Commit 798da54

Browse files
committed
remove another occurence
1 parent 924cf81 commit 798da54

File tree

1 file changed

+22
-29
lines changed

1 file changed

+22
-29
lines changed

Diff for: src/Analyser/MutatingScope.php

+22-29
Original file line numberDiff line numberDiff line change
@@ -2237,19 +2237,16 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
22372237
return $this->getNullsafeShortCircuitingType($node->var, $nativeType);
22382238
}
22392239

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+
}
22512248

2252-
return $this->getNullsafeShortCircuitingType($node->var, $typeCallback());
2249+
return $this->getNullsafeShortCircuitingType($node->var, $returnType);
22532250
}
22542251

22552252
$nameType = $this->getType($node->name);
@@ -2300,25 +2297,21 @@ static function (Node $node, Scope $scope) use ($arrowScope, &$arrowFunctionImpu
23002297
return $nativeType;
23012298
}
23022299

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+
}
23092305

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+
}
23202314

2321-
$fetchType = $typeCallback();
23222315
if ($node->class instanceof Expr) {
23232316
return $this->getNullsafeShortCircuitingType($node->class, $fetchType);
23242317
}

0 commit comments

Comments
 (0)