diff --git a/src/Dependency/DependencyResolver.php b/src/Dependency/DependencyResolver.php index f798f0dc6e..ce31ac9403 100644 --- a/src/Dependency/DependencyResolver.php +++ b/src/Dependency/DependencyResolver.php @@ -199,13 +199,14 @@ public function resolveDependencies(Node $node, Scope $scope): NodeDependencies private function considerArrayForCallableTest(Scope $scope, Array_ $arrayNode): bool { - if (!isset($arrayNode->items[0])) { + $items = $arrayNode->items[0]; + if (count($items) !== 2) { return false; } - $itemType = $scope->getType($arrayNode->items[0]->value); + $itemType = $scope->getType($items[0]->value); if (!$itemType instanceof ConstantStringType) { - return true; + return false; } return $itemType->isClassString();