зеркало из https://github.com/nextcloud/cookbook.git
Apply suggestions from code review
Adding the spelling issues from the code review process Signed-Off-By: Christian Wolf <github@christianwolf.email> Co-authored-by: Sebastian Fey <info@sebastianfey.de>
This commit is contained in:
Родитель
96663d99f7
Коммит
3ffeec8d70
|
@ -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 {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]));
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче