Skip to content

Commit

Permalink
DependencyResolver - cause autoloading less often when looking at lit…
Browse files Browse the repository at this point in the history
…eral arrays
  • Loading branch information
ondrejmirtes committed Dec 10, 2021
1 parent f69886f commit b927c87
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Dependency/DependencyResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit b927c87

Please sign in to comment.