Skip to content

Commit

Permalink
StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
andreia committed Feb 14, 2023
1 parent f441caa commit 0923411
Showing 1 changed file with 28 additions and 36 deletions.
64 changes: 28 additions & 36 deletions src/Http/Controllers/UppyS3MultipartController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ public function __construct()
/**
* Encode URI.
*
* @param string $str
* @return string The encoded URI string
* @param string $str
*
* @return string The encoded URI string
*/
protected function encodeURIComponent(string $str)
{
Expand All @@ -40,7 +41,7 @@ protected function encodeURIComponent(string $str)
/**
* Add the preflight response header so it's possible to use the X-CSRF-TOKEN on Uppy request header.
*
* @return string JSON with 204 status no content
* @return string JSON with 204 status no content
*/
public function createPreflightHeader(Request $request)
{
Expand All @@ -57,7 +58,6 @@ public function createPreflightHeader(Request $request)
*
* @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-s3-2006-03-01.html#createmultipartupload S3 Syntax
* @see https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html S3 Syntax
*
* $result = $client->createMultipartUpload([
* 'ACL' => 'private|public-read|public-read-write|authenticated-read|aws-exec-read|bucket-owner-read|bucket-owner-full-control',
* 'Bucket' => '<string>', // REQUIRED
Expand Down Expand Up @@ -89,17 +89,16 @@ public function createPreflightHeader(Request $request)
* 'Tagging' => '<string>',
* 'WebsiteRedirectLocation' => '<string>',
* ]);
*
* @see https://github.com/transloadit/uppy/blob/master/packages/%40uppy/aws-s3-multipart/src/index.js Uppy call to this endpoint
*
* return this.#client.post('s3/multipart', {
* filename: file.name,
* type: file.type,
* metadata,
* }, { signal }).then(assertServerError)
*
* @param \Illuminate\Http\Request $request
* @return string JSON with the uploaded parts
* @param \Illuminate\Http\Request $request
*
* @return string JSON with the uploaded parts
*/
public function createMultipartUpload(Request $request)
{
Expand Down Expand Up @@ -134,9 +133,10 @@ public function createMultipartUpload(Request $request)
/**
* List the multipart uploaded parts.
*
* @param \Illuminate\Http\Request $request
* @param string $uploadId
* @return string JSON with the uploaded parts
* @param \Illuminate\Http\Request $request
* @param string $uploadId
*
* @return string JSON with the uploaded parts
*/
public function getUploadedParts(Request $request, string $uploadId)
{
Expand All @@ -151,9 +151,7 @@ public function getUploadedParts(Request $request, string $uploadId)
/**
* Get the uploaded parts. Retry the part if it's truncated.
*
*
* @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-s3-2006-03-01.html#listparts S3 Syntax
*
* $result = $client->listParts([
* 'Bucket' => '<string>', // REQUIRED
* 'ExpectedBucketOwner' => '<string>',
Expand All @@ -163,15 +161,14 @@ public function getUploadedParts(Request $request, string $uploadId)
* 'RequestPayer' => 'requester',
* 'UploadId' => '<string>', // REQUIRED
* ]);
*
* @see https://github.com/transloadit/uppy/blob/master/packages/%40uppy/aws-s3-multipart/src/index.js Uppy call to this endpoint
*
* return this.#client.get(`s3/multipart/${uploadId}?key=${filename}`, { signal })
* .then(assertServerError)
*
* @param string $key
* @param string $uploadId
* @param int $partIndex
* @param string $key
* @param string $uploadId
* @param int $partIndex
*
* @return \Illuminate\Support\Collection
*/
private function listPartsPage(string $key, string $uploadId, int $partIndex, $parts = null)
Expand Down Expand Up @@ -201,7 +198,6 @@ private function listPartsPage(string $key, string $uploadId, int $partIndex, $p
* Completes a multipart upload by assembling previously uploaded parts.
*
* @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-s3-2006-03-01.html#completemultipartupload S3 Syntax
*
* $result = $client->completeMultipartUpload([
* 'Bucket' => '<string>', // REQUIRED
* 'ExpectedBucketOwner' => '<string>',
Expand All @@ -218,14 +214,13 @@ private function listPartsPage(string $key, string $uploadId, int $partIndex, $p
* 'RequestPayer' => 'requester',
* 'UploadId' => '<string>', // REQUIRED
* ]);
*
* @see https://github.com/transloadit/uppy/blob/master/packages/%40uppy/aws-s3-multipart/src/index.js Uppy call to this endpoint
*
* return this.#client.post(`s3/multipart/${uploadIdEnc}/complete?key=${filename}`, { parts }, { signal })
* .then(assertServerError)
*
* @param \Illuminate\Http\Request $request
* @param string $uploadId
* @param \Illuminate\Http\Request $request
* @param string $uploadId
*
* @return string
*/
public function completeMultipartUpload(Request $request, string $uploadId)
Expand Down Expand Up @@ -264,23 +259,21 @@ public function completeMultipartUpload(Request $request, string $uploadId)
* Aborts a multipart upload, deleting the uploaded parts.
*
* @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-s3-2006-03-01.html#abortmultipartupload S3 Syntax
*
* $result = $client->abortMultipartUpload([
* 'Bucket' => '<string>', // REQUIRED
* 'ExpectedBucketOwner' => '<string>',
* 'Key' => '<string>', // REQUIRED
* 'RequestPayer' => 'requester',
* 'UploadId' => '<string>', // REQUIRED
* ]);
*
* @see https://github.com/transloadit/uppy/blob/master/packages/%40uppy/aws-s3-multipart/src/index.js Uppy call to this endpoint
*
* return this.#client.delete(`s3/multipart/${uploadIdEnc}?key=${filename}`, undefined, { signal })
* .then(assertServerError)
*
* @param \Illuminate\Http\Request $request
* @param string $uploadId
* @return string JSON empty
* @param \Illuminate\Http\Request $request
* @param string $uploadId
*
* @return string JSON empty
*/
public function abortMultipartUpload(Request $request, string $uploadId)
{
Expand All @@ -299,8 +292,9 @@ public function abortMultipartUpload(Request $request, string $uploadId)
/**
* Presign a URL for a part.
*
* @param \Illuminate\Http\Request $request
* @return string JSON with the URL
* @param \Illuminate\Http\Request $request
*
* @return string JSON with the URL
*/
public function signPartUpload(Request $request)
{
Expand All @@ -316,7 +310,6 @@ public function signPartUpload(Request $request)
* Get the presigned URL for a part.
*
* @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-s3-2006-03-01.html#uploadpart S3 Syntax
*
* $result = $client->uploadPart([
* 'Body' => <string || resource || Psr\Http\Message\StreamInterface>,
* 'Bucket' => '<string>', // REQUIRED
Expand All @@ -332,14 +325,13 @@ public function signPartUpload(Request $request)
* 'SourceFile' => '<string>',
* 'UploadId' => '<string>', // REQUIRED
* ]);
*
* @see https://github.com/transloadit/uppy/blob/master/packages/%40uppy/aws-s3-multipart/src/index.js Uppy call to this endpoint
*
* return this.#client.get(`s3/multipart/${uploadId}/${partNumber}?key=${filename}`, { signal })
* .then(assertServerError)
*
* @param \Illuminate\Http\Request $request
* @param int $partNumber
* @param \Illuminate\Http\Request $request
* @param int $partNumber
*
* @return string
*/
public function getSignedUrl(Request $request, int $partNumber)
Expand Down

0 comments on commit 0923411

Please sign in to comment.