lint: fix php

Signed-off-by: Varun Patil <varunpatil@ucla.edu>
pull/563/head
Varun Patil 2023-03-29 16:19:31 -07:00
parent 8c881f0488
commit c65ad77be3
1 changed files with 6 additions and 5 deletions

View File

@ -279,11 +279,12 @@ class ImageController extends GenericApiController
*
* @return array [blob, mimetype]
*/
private function getImageJPEG($blob, $mimetype): array {
private function getImageJPEG($blob, $mimetype): array
{
// TODO: Use imaginary if available
// Check if Imagick is available
if (!\class_exists('Imagick')) {
if (!class_exists('Imagick')) {
throw Exceptions::Forbidden('Imagick extension is not available');
}
@ -292,7 +293,7 @@ class ImageController extends GenericApiController
$image = new \Imagick();
$image->readImageBlob($blob);
} catch (\ImagickException $e) {
throw Exceptions::Forbidden('Imagick failed to read image: '. $e->getMessage());
throw Exceptions::Forbidden('Imagick failed to read image: '.$e->getMessage());
}
// Convert to JPEG
@ -303,7 +304,7 @@ class ImageController extends GenericApiController
$blob = $image->getImageBlob();
$mimetype = $image->getImageMimeType();
} catch (\ImagickException $e) {
throw Exceptions::Forbidden('Imagick failed to convert image: '. $e->getMessage());
throw Exceptions::Forbidden('Imagick failed to convert image: '.$e->getMessage());
}
return [$blob, $mimetype];