From 28020bd5a451fd84f22886e4358261610885b2af Mon Sep 17 00:00:00 2001 From: Fabien Villepinte Date: Wed, 29 Dec 2021 16:03:02 +0000 Subject: [PATCH] Fetch 100 releases at a time --- src/services/resolver/PharIoAliasResolver.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/services/resolver/PharIoAliasResolver.php b/src/services/resolver/PharIoAliasResolver.php index 3b4e9107..2f5e3413 100644 --- a/src/services/resolver/PharIoAliasResolver.php +++ b/src/services/resolver/PharIoAliasResolver.php @@ -35,7 +35,7 @@ public function resolve(RequestedPhar $requestedPhar): SourceRepository { try { $source = $this->getSourcesList()->getSourceForAlias($requestedPhar->getAlias()); - $file = $this->fileDownloader->download($source->getUrl()); + $file = $this->fileDownloader->download($this->getUrl($source)); } catch (SourcesListException $e) { return $this->tryNext($requestedPhar); } @@ -68,4 +68,14 @@ protected function getSourcesList(): SourcesList { return $this->sources; } + + private function getUrl(Source $source): Url { + $url = $source->getUrl(); + + if ($source->getType() === 'github') { + $url = $url->withParams(['per_page' => 100]); + } + + return $url; + } }