From 64f0fd08891ac5018fce8002246438b3e31159f6 Mon Sep 17 00:00:00 2001
From: Olivier Paroz <github@oparoz.com>
Date: Thu, 18 Jun 2015 13:30:10 +0200
Subject: Remove unneeded returns from private cropping methods

---
 lib/private/preview.php | 22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/lib/private/preview.php b/lib/private/preview.php
index 3a341500e67..731e9992310 100644
--- a/lib/private/preview.php
+++ b/lib/private/preview.php
@@ -812,9 +812,8 @@ class Preview {
 		 */
 		// It turns out the scaled preview is now too big, so we crop the image
 		if ($newPreviewWidth >= $askedWidth && $newPreviewHeight >= $askedHeight) {
-			list($newPreviewWidth, $newPreviewHeight) =
-				$this->crop($image, $askedWidth, $askedHeight, $newPreviewWidth, $newPreviewHeight);
-			$this->storePreview($fileId, $newPreviewWidth, $newPreviewHeight);
+			$this->crop($image, $askedWidth, $askedHeight, $newPreviewWidth, $newPreviewHeight);
+			$this->storePreview($fileId, $askedWidth, $askedHeight);
 
 			return;
 		}
@@ -822,11 +821,10 @@ class Preview {
 		// At least one dimension of the scaled preview is too small,
 		// so we fill the space with a transparent background
 		if (($newPreviewWidth < $askedWidth || $newPreviewHeight < $askedHeight)) {
-			list($newPreviewWidth, $newPreviewHeight) =
-				$this->cropAndFill(
-					$image, $askedWidth, $askedHeight, $newPreviewWidth, $newPreviewHeight
-				);
-			$this->storePreview($fileId, $newPreviewWidth, $newPreviewHeight);
+			$this->cropAndFill(
+				$image, $askedWidth, $askedHeight, $newPreviewWidth, $newPreviewHeight
+			);
+			$this->storePreview($fileId, $askedWidth, $askedHeight);
 
 			return;
 		}
@@ -894,8 +892,6 @@ class Preview {
 	 * @param int $askedHeight
 	 * @param int $previewWidth
 	 * @param null $previewHeight
-	 *
-	 * @return \int[]
 	 */
 	private function crop($image, $askedWidth, $askedHeight, $previewWidth, $previewHeight = null) {
 		$cropX = floor(abs($askedWidth - $previewWidth) * 0.5);
@@ -904,8 +900,6 @@ class Preview {
 		$cropY = 0;
 		$image->crop($cropX, $cropY, $askedWidth, $askedHeight);
 		$this->preview = $image;
-
-		return [$askedWidth, $askedHeight];
 	}
 
 	/**
@@ -917,8 +911,6 @@ class Preview {
 	 * @param int $askedHeight
 	 * @param int $previewWidth
 	 * @param null $previewHeight
-	 *
-	 * @return \int[]
 	 */
 	private function cropAndFill($image, $askedWidth, $askedHeight, $previewWidth, $previewHeight) {
 		if ($previewWidth > $askedWidth) {
@@ -954,8 +946,6 @@ class Preview {
 		$image = new \OC_Image($backgroundLayer);
 
 		$this->preview = $image;
-
-		return [$askedWidth, $askedHeight];
 	}
 
 	/**
-- 
cgit v1.2.3