From ec6a4d03954f2d7539dceb59b14ed84a88fb6d0e Mon Sep 17 00:00:00 2001 From: Uladzimir Tsykun Date: Sat, 2 Nov 2024 18:27:07 +0100 Subject: [PATCH] Decorate composer repository --- .../Repository/ComposerProxyRepository.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Composer/Repository/ComposerProxyRepository.php b/src/Composer/Repository/ComposerProxyRepository.php index 80eb09be..d635ec1f 100644 --- a/src/Composer/Repository/ComposerProxyRepository.php +++ b/src/Composer/Repository/ComposerProxyRepository.php @@ -6,13 +6,15 @@ use Composer\Config; use Composer\IO\IOInterface; +use Composer\Repository\ArrayRepository; use Composer\Repository\ComposerRepository; use Composer\Util\HttpDownloader; use Composer\Util\ProcessExecutor; -class ComposerProxyRepository extends ComposerRepository implements PacketonRepositoryInterface +class ComposerProxyRepository extends ArrayRepository implements PacketonRepositoryInterface { private string $packageName; + private ComposerRepository $repository; public function __construct( protected array $repoConfig, @@ -21,8 +23,9 @@ public function __construct( protected HttpDownloader $httpDownloader, protected ?ProcessExecutor $process = null ) { - parent::__construct($repoConfig, $io, $config, $httpDownloader); + parent::__construct(); + $this->repository = new ComposerRepository($repoConfig, $io, $config, $httpDownloader); $this->packageName = $this->repoConfig['packageName']; $this->process ??= new ProcessExecutor($this->io); } @@ -34,7 +37,7 @@ public function getHttpDownloader(): HttpDownloader public function getPackages(): array { - return $this->findPackages($this->packageName); + return $this->repository->findPackages($this->packageName); } public function getProcessExecutor(): ProcessExecutor @@ -51,4 +54,9 @@ public function getIO(): IOInterface { return $this->io; } + + public function getRepoConfig() + { + return $this->repository->getRepoConfig(); + } }