Skip to content

Commit

Permalink
Fix LogicException for composer ^2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
baukevdw committed Jul 26, 2022
1 parent 1314350 commit a9c6bb7
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/Composer/StudioPlugin.php
Expand Up @@ -58,11 +58,23 @@ public function registerStudioPackages()
foreach ($this->getManagedPaths() as $path) {
$this->io->writeError("[Studio] Loading path $path");

$repoManager->prependRepository(new PathRepository(
['url' => $path],
$this->io,
$composerConfig
));
// In case composer version >= 2.3.0
if (method_exists($this->composer, 'getLoop')) {
$repoManager->prependRepository(new PathRepository(
['url' => $path],
$this->io,
$composerConfig,
$this->composer->getLoop()->getHttpDownloader(),
$this->composer->getEventDispatcher(),
$this->composer->getLoop()->getProcessExecutor()
));
} else {
$repoManager->prependRepository(new PathRepository(
['url' => $path],
$this->io,
$composerConfig
));
}
}
}

Expand Down

0 comments on commit a9c6bb7

Please sign in to comment.