Skip to content

Commit

Permalink
Prevent unnecessary recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHenryIE committed Dec 6, 2023
1 parent 503f110 commit d26e040
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Console/Commands/Compose.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit d26e040

Please sign in to comment.