Skip to content

Commit 3802f72

Browse files
committed
Prevent unnecessary work
1 parent 8ac3a91 commit 3802f72

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/Dependency/DependencyResolver.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,22 @@ private function considerArrayForCallableTest(Scope $scope, Array_ $arrayNode):
512512
return false;
513513
}
514514

515+
if (
516+
$items[0]->value instanceof Array_
517+
|| $items[0]->value instanceof Node\Scalar\Int_
518+
|| $items[0]->value instanceof Node\Scalar\Float_
519+
) {
520+
return false;
521+
}
522+
523+
if (
524+
$items[1]->value instanceof Array_
525+
|| $items[1]->value instanceof Node\Scalar\Int_
526+
|| $items[1]->value instanceof Node\Scalar\Float_
527+
) {
528+
return false;
529+
}
530+
515531
$itemType = $scope->getType($items[0]->value);
516532
return $itemType->isClassString()->yes();
517533
}

0 commit comments

Comments
 (0)