Skip to content

Commit

Permalink
bug #672 Fix compat with composer v2 (nicolas-grekas)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.8-dev branch.

Discussion
----------

Fix compat with composer v2

Fix #671

Commits
-------

62b4a98 Fix compat with composer v2
  • Loading branch information
nicolas-grekas committed Aug 25, 2020
2 parents daa5ab6 + 62b4a98 commit 0256511
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ParallelDownloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public function callbackGet($notificationCode, $severity, $message, $messageCode
/**
* {@inheritdoc}
*/
protected function getRemoteContents($originUrl, $fileUrl, $context, array &$responseHeaders = null)
protected function getRemoteContents($originUrl, $fileUrl, $context, array &$responseHeaders = null, $maxFileSize = null)
{
if (isset(self::$cache[$fileUrl])) {
self::$cacheNext = false;
Expand All @@ -234,7 +234,7 @@ protected function getRemoteContents($originUrl, $fileUrl, $context, array &$res
self::$cacheNext = false;

if (3 < \func_num_args()) {
$result = $this->getRemoteContents($originUrl, $fileUrl, $context, $responseHeaders);
$result = $this->getRemoteContents($originUrl, $fileUrl, $context, $responseHeaders, $maxFileSize);
self::$cache[$fileUrl] = [$responseHeaders, $result];
} else {
$result = $this->getRemoteContents($originUrl, $fileUrl, $context);
Expand All @@ -245,7 +245,7 @@ protected function getRemoteContents($originUrl, $fileUrl, $context, array &$res
}

if (!$this->downloader || !preg_match('/^https?:/', $fileUrl)) {
return parent::getRemoteContents($originUrl, $fileUrl, $context, $responseHeaders);
return parent::getRemoteContents($originUrl, $fileUrl, $context, $responseHeaders, $maxFileSize);
}

try {
Expand All @@ -259,7 +259,7 @@ protected function getRemoteContents($originUrl, $fileUrl, $context, array &$res
} catch (TransportException $e) {
$this->io->writeError('Retrying download: '.$e->getMessage(), true, IOInterface::DEBUG);

return parent::getRemoteContents($originUrl, $fileUrl, $context, $responseHeaders);
return parent::getRemoteContents($originUrl, $fileUrl, $context, $responseHeaders, $maxFileSize);
} catch (\Throwable $e) {
$responseHeaders = [];
throw $e;
Expand Down

0 comments on commit 0256511

Please sign in to comment.