From 97518b901818bb7a90fb6fa57731f71e01da224d Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 19 Apr 2022 10:52:24 +0200 Subject: [PATCH 1/2] Fix matrix variable reference in Github static-analysis action Signed-off-by: Jonas --- .github/workflows/static-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 043e9747504..e2caf4ca3d9 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -16,7 +16,7 @@ jobs: - name: Set up php uses: shivammathur/setup-php@master with: - php-version: {{ matrix.php-version }} + php-version: ${{ matrix.php-version }} tools: composer:v1 coverage: none - name: Install dependencies From 4dc2a779f5bf4420a19babc12c1f2bbbb853e1ce Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 19 Apr 2022 11:01:12 +0200 Subject: [PATCH 2/2] ImageController: Fix issues spotted by psalm Signed-off-by: Jonas --- lib/Controller/ImageController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Controller/ImageController.php b/lib/Controller/ImageController.php index 108a86a1033..4ccd5b3139c 100644 --- a/lib/Controller/ImageController.php +++ b/lib/Controller/ImageController.php @@ -150,7 +150,7 @@ public function uploadImage(int $documentId, int $sessionId, string $sessionToke $userId = $this->getUserIdFromSession($documentId, $sessionId, $sessionToken); $uploadResult = $this->imageService->uploadImage($documentId, $newFileName, $newFileResource, $userId); } - if (isset($insertResult['error'])) { + if (isset($uploadResult['error'])) { return new DataResponse($uploadResult, Http::STATUS_BAD_REQUEST); } else { return new DataResponse($uploadResult); @@ -220,7 +220,7 @@ public function getImage(int $documentId, int $sessionId, string $sessionToken, return $imageFile !== null ? new DataDownloadResponse( $imageFile->getContent(), - Http::STATUS_OK, + (string) Http::STATUS_OK, $this->getSecureMimeType($imageFile->getMimeType()) ) : new DataResponse('', Http::STATUS_NOT_FOUND);