From 3ffeec8d705b1a2f974bfa8856d10ef965bd151b Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 28 Mar 2022 13:49:57 +0200 Subject: [PATCH] Apply suggestions from code review Adding the spelling issues from the code review process Signed-Off-By: Christian Wolf Co-authored-by: Sebastian Fey --- lib/Helper/ImageService/ImageFileHelper.php | 4 ++-- lib/Helper/ImageService/ImageGenerationHelper.php | 6 +++--- lib/Service/ImageService.php | 8 ++++---- lib/Service/RecipeService.php | 3 ++- lib/Service/ThumbnailService.php | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/Helper/ImageService/ImageFileHelper.php b/lib/Helper/ImageService/ImageFileHelper.php index 0bc275cd..2ffee48d 100644 --- a/lib/Helper/ImageService/ImageFileHelper.php +++ b/lib/Helper/ImageService/ImageFileHelper.php @@ -35,7 +35,7 @@ class ImageFileHelper { } /** - * Check if a recipe has a folder attached + * Check if a recipe folder contains an image * * @param Folder $recipeFolder The folder of the recipe to check * @return boolean true, if there is an image present @@ -47,7 +47,7 @@ class ImageFileHelper { /** * Drop the image of a recipe * - * @param Folder $recipeFolder The folder contraining the recipe + * @param Folder $recipeFolder The folder containing the recipe * @return void */ public function dropImage(Folder $recipeFolder): void { diff --git a/lib/Helper/ImageService/ImageGenerationHelper.php b/lib/Helper/ImageService/ImageGenerationHelper.php index 56c54529..6345696f 100644 --- a/lib/Helper/ImageService/ImageGenerationHelper.php +++ b/lib/Helper/ImageService/ImageGenerationHelper.php @@ -7,7 +7,7 @@ use OCP\Files\Folder; use OCA\Cookbook\Service\ThumbnailService; /** - * This class provides heler function to generate appropriate thumbnails according to the needs. + * This class provides helper function to generate appropriate thumbnails according to the needs. */ class ImageGenerationHelper { private const MAP = [ @@ -31,7 +31,7 @@ class ImageGenerationHelper { * Calculate the image data of a thumbnail of defined size and store it in the nextcloud server storage. * * @param File $fullImage The full-sized image to use as a starting point - * @param int $type The requested size of the thunbmail + * @param int $type The requested size of the thumbnail * @param File $dstFile The name of the file to store the thumbnail to * @return void */ @@ -51,7 +51,7 @@ class ImageGenerationHelper { /** * Ensure that a thumbnail is not existing in the file system. * - * This method checks if a certain thumbail size is present in the recipe folder and removes the file accordingly. + * This method checks if a certain thumbnail size is present in the recipe folder and removes the file accordingly. * Note: If the thumbnail is not present, this method does nothing. * * The main image will not be dropped. diff --git a/lib/Service/ImageService.php b/lib/Service/ImageService.php index 041f0c1c..d1a94851 100644 --- a/lib/Service/ImageService.php +++ b/lib/Service/ImageService.php @@ -35,7 +35,7 @@ class ImageService { } /** - * Get the main image from a recipe + * Get the main image of a recipe * * @param Folder $recipeFolder The folder of the recipe * @return string The image file data @@ -57,7 +57,7 @@ class ImageService { } /** - * Check if a recipe has a folder attached + * Check if a recipe folder contains an image * * @param Folder $recipeFolder The folder of the recipe to check * @return boolean true, if there is an image present @@ -92,7 +92,7 @@ class ImageService { } /** - * Obtain a thumbnail from a recipe as a file for further processing + * Obtain a thumbnail of a recipe's primary image as a file for further processing * * @param Folder $recipeFolder The folder containing the recipe * @param integer $type The type of the thumbnail to obtain @@ -106,7 +106,7 @@ class ImageService { /** * Store a new image in the recipe folder. * - * This will store the datan and recreate the thumbnails to keep them up to date. + * This will store the data and recreate the thumbnails to keep them up to date. * * @param Folder $recipeFolder The recipe folder to store the image to * @param string $data The image data diff --git a/lib/Service/RecipeService.php b/lib/Service/RecipeService.php index 2740e4e2..f4be1e17 100755 --- a/lib/Service/RecipeService.php +++ b/lib/Service/RecipeService.php @@ -1097,7 +1097,8 @@ class RecipeService { * * @return File */ - public function getRecipeImageFileByFolderId($id, $size = 'thumb') { + public function getRecipeImageFileByFolderId($id, $size = 'thumb'): File + { $recipe_folders = $this->root->getById($id); if (count($recipe_folders) < 1) { throw new Exception($this->il10n->t('Recipe with id %d not found.', [$id])); diff --git a/lib/Service/ThumbnailService.php b/lib/Service/ThumbnailService.php index f0b03d63..6a5c8420 100644 --- a/lib/Service/ThumbnailService.php +++ b/lib/Service/ThumbnailService.php @@ -10,8 +10,8 @@ use OCP\Image; /** * This class carries out the creation of the thumbnail images for the recipes. * - * It uses only the in memory representations to avoid file IO if not needed. - * You need to store the images if they should be prreserved. + * It uses only the in-memory representations to avoid file IO if not needed. + * You need to store the images if they should be preserved. */ class ThumbnailService {