-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TaskProcessing follow-up #46368
TaskProcessing follow-up #46368
Conversation
* Use field 'file' for the file upload | ||
* | ||
* @param int $taskId The id of the task | ||
* @return DataResponse<Http::STATUS_CREATED, array{fileId: int}, array{}>|DataResponse<Http::STATUS_INTERNAL_SERVER_ERROR|Http::STATUS_NOT_FOUND, array{message: string}, array{}> |
Check failure
Code scanning / Psalm
InvalidReturnType Error
$task = $this->taskProcessingManager->getTask($taskId); | ||
$file = $this->request->getUploadedFile('file'); | ||
if (!isset($file['tmp_name'])) { | ||
return new DataResponse(['message' => $this->l->t('Bad request')], Http::STATUS_BAD_REQUEST); |
Check failure
Code scanning / Psalm
InvalidReturnStatement Error
return new DataResponse(['message' => $this->l->t('Bad request')], Http::STATUS_BAD_REQUEST); | ||
} | ||
$data = file_get_contents($file['tmp_name']); | ||
if (!$data) { |
Check notice
Code scanning / Psalm
RiskyTruthyFalsyComparison Note
08375ad
to
081eed7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
$task = $this->taskProcessingManager->getTask($taskId); | ||
$file = $this->request->getUploadedFile('file'); | ||
if (!isset($file['tmp_name'])) { | ||
return new DataResponse(['message' => $this->l->t('Bad request')], Http::STATUS_BAD_REQUEST); |
Check failure
Code scanning / Psalm
InvalidReturnStatement Error
@@ -493,4 +529,15 @@ | |||
return new DataResponse(['message' => $this->l->t('Internal error')], Http::STATUS_INTERNAL_SERVER_ERROR); | |||
} | |||
} | |||
|
|||
private function setFileContentsInternal($data): int { |
Check notice
Code scanning / Psalm
MissingParamType Note
58ad083
to
369681f
Compare
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Differentiate between output with file IDs and output with File data Signed-off-by: Marcel Klehr <mklehr@gmx.net>
…h ID instead of File object Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Alexander Piskun <bigcat88@icloud.com> Signed-off-by: Marcel Klehr <mklehr@gmx.net>
…h ID instead of File object Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
… names Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
…tegers Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
369681f
to
6ff4524
Compare
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
Pick up and solve lose ends in TaskProcessing
Checklist