1
0
Fork 0
mirror of synced 2024-07-06 07:00:56 +12:00

Apply suggestions from code review

Co-authored-by: Eldad A. Fux <eldad.fux@gmail.com>
This commit is contained in:
Damodar Lohani 2021-06-24 12:46:29 +05:45 committed by GitHub
parent 9a955e0244
commit 5dae32d56f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -281,7 +281,7 @@ App::post('/v1/storage/buckets/:bucketId/files')
$bucket = $dbForInternal->getDocument('buckets', $bucketId);
if($bucket->isEmpty()) {
throw new Exception("Bucket not found", 404);
throw new Exception('Bucket not found', 404);
}
$file = $request->getFiles('file');
@ -420,7 +420,7 @@ App::get('/v1/storage/buckets/:bucketId/files')
$bucket = $dbForInternal->getDocument('buckets', $bucketId);
if($bucket->isEmpty()) {
throw new Exception("Bucket not found", 404);
throw new Exception('Bucket not found', 404);
}
$queries = [new Query('bucketId', Query::TYPE_EQUAL, [$bucketId])];
@ -457,7 +457,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId')
$bucket = $dbForInternal->getDocument('buckets', $bucketId);
if($bucket->isEmpty()) {
throw new Exception("Bucket not found", 404);
throw new Exception('Bucket not found', 404);
}
$file = $dbForInternal->getDocument('files', $fileId);
@ -515,7 +515,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
$bucket = $dbForInternal->getDocument('buckets', $bucketId);
if($bucket->isEmpty()) {
throw new Exception("Bucket not found", 404);
throw new Exception('Bucket not found', 404);
}
if ((\strpos($request->getAccept(), 'image/webp') === false) && ('webp' == $output)) { // Fallback webp to jpeg when no browser support
@ -650,7 +650,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download')
$bucket = $dbForInternal->getDocument('buckets', $bucketId);
if($bucket->isEmpty()) {
throw new Exception("Bucket not found", 404);
throw new Exception('Bucket not found', 404);
}
$file = $dbForInternal->getDocument('files', $fileId);
@ -715,7 +715,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view')
$bucket = $dbForInternal->getDocument('buckets', $bucketId);
if($bucket->isEmpty()) {
throw new Exception("Bucket not found", 404);
throw new Exception('Bucket not found', 404);
}
$file = $dbForInternal->getDocument('files', $fileId);
@ -795,7 +795,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId')
$bucket = $dbForInternal->getDocument('buckets', $bucketId);
if($bucket->isEmpty()) {
throw new Exception("Bucket not found", 404);
throw new Exception('Bucket not found', 404);
}
$file = $dbForInternal->getDocument('files', $fileId);
@ -845,7 +845,7 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId')
$bucket = $dbForInternal->getDocument('buckets', $bucketId);
if($bucket->isEmpty()) {
throw new Exception("Bucket not found", 404);
throw new Exception('Bucket not found', 404);
}
$file = $dbForInternal->getDocument('files', $fileId);