TappNetwork/laravel-uppy-s3-multipart-upload

Variable not initialized

Closed this issue · 2 comments

jtrod commented

Hi great package, very helpful.. Thanks a lot.

I was wondering where the $partResponse['NextPartNumberMarker'] is being initialized at line 172. My IDE flags it as not initialized, even though this being a recursive call.

private function listPartsPage($key, $uploadId, $partIndex, $parts = null)
{
$parts = $parts ?? collect();
$results = $this->client->listParts([
'Bucket' => $this->bucket,
'Key' => $key,
'UploadId' => $uploadId,
'PartNumberMarker' => $partIndex,
]);
if ($results['Parts']) {
$parts = $parts->concat($results['Parts']);
if ($results['IsTruncated']) {
$results = $this->listPartsPage($key, $uploadId, $partResponse['NextPartNumberMarker'], $parts);
$parts = $parts->concat($partResponse['Parts']);
}
}

@jtrod Thank you, really glad you found it helpful!
I just added a fix.
Please let me know if everything is okay :)

jtrod commented

Awesome! Thanks for sharing this with the community!
Very helpful!