From d26e040ebfc1f8cfca90c2f3a78fc4c04ca49823 Mon Sep 17 00:00:00 2001 From: Brian Henry Date: Tue, 5 Dec 2023 20:53:38 -0800 Subject: [PATCH] Prevent unnecessary recursion --- src/Console/Commands/Compose.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Console/Commands/Compose.php b/src/Console/Commands/Compose.php index 9606dd4b..f927e58c 100644 --- a/src/Console/Commands/Compose.php +++ b/src/Console/Commands/Compose.php @@ -200,6 +200,10 @@ protected function recursiveGetAllDependencies(array $requiredPackageNames): voi $requiredComposerPackage = ComposerPackage::fromComposerJsonArray($requiredPackageComposerJson, $overrideAutoload); } + if (isset($this->flatDependencyTree[$requiredComposerPackage->getPackageName()])) { + continue; + } + $this->flatDependencyTree[$requiredComposerPackage->getPackageName()] = $requiredComposerPackage; $nextRequiredPackageNames = $requiredComposerPackage->getRequiresNames();