mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 03:35:01 +01:00
fix return dim array fetch
This commit is contained in:
parent
c025d4c33d
commit
4c35675cca
@ -344,14 +344,15 @@ final class NodeTypeResolver
|
||||
return $node instanceof Expr && $this->arrayTypeAnalyzer->isArrayType($node);
|
||||
}
|
||||
|
||||
private function resolveArrayType(Expr $expr): ArrayType
|
||||
private function resolveArrayType(Expr $expr): Type
|
||||
{
|
||||
/** @var Scope|null $scope */
|
||||
$scope = $expr->getAttribute(AttributeKey::SCOPE);
|
||||
|
||||
if ($scope instanceof Scope) {
|
||||
$arrayType = $scope->getType($expr);
|
||||
if ($arrayType instanceof ArrayType) {
|
||||
|
||||
if ($arrayType !== null) {
|
||||
return $arrayType;
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ final class ReturnedNodesReturnTypeInferer extends AbstractTypeInferer implement
|
||||
}
|
||||
|
||||
$localReturnNodes = $this->collectReturns($functionLike);
|
||||
|
||||
if ($localReturnNodes === []) {
|
||||
// void type
|
||||
if ($functionLike instanceof ClassMethod && ! $functionLike->isAbstract()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user