From 5f2456ee7c4c317a6feefb12895df93707410726 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sun, 24 Feb 2013 20:07:30 +0100 Subject: [PATCH] psr fixes --- src/Intervention/Image/Image.php | 14 +++++++------- tests/ImageTest.php | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Intervention/Image/Image.php b/src/Intervention/Image/Image.php index eb46ca4e..a90e152e 100644 --- a/src/Intervention/Image/Image.php +++ b/src/Intervention/Image/Image.php @@ -188,7 +188,7 @@ class Image * * Width and height are optional, the not given parameter is calculated * based on the given. The ratio boolean decides whether the resizing - * should keep the image ratio. You can also pass along a boolean to + * should keep the image ratio. You can also pass along a boolean to * prevent the image from being upsized. * * @param integer $width The target width for the image @@ -219,12 +219,12 @@ class Image if ( ! is_null($width) && ! is_null($height)) { // First, calculate the height. $height = intval($width / $this->width * $this->height); - + // If the height is too large, set it to the maximum // height and calculate the width. if ($height > $max_height) { - $height = $max_height; - $width = intval($height / $this->height * $this->width); + $height = $max_height; + $width = intval($height / $this->height * $this->width); } } @@ -267,12 +267,12 @@ class Image throw new Exception('width or height needs to be defined'); } - // If only the width hasn't been set, keep the current width. + // If only the width hasn't been set, keep the current width. else if (is_null($width) ) { $width = $this->width; } - // If only the height hasn't been set, keep the current height. + // If only the height hasn't been set, keep the current height. else if (is_null($height) ) { $height = $this->height; } @@ -283,7 +283,7 @@ class Image /** * Legacy method to support old resizing calls - * + * * @param array $dimensions * @return Image */ diff --git a/tests/ImageTest.php b/tests/ImageTest.php index b9f16a20..347bf287 100644 --- a/tests/ImageTest.php +++ b/tests/ImageTest.php @@ -80,7 +80,7 @@ class ImageTest extends PHPUnit_Framework_Testcase $this->assertInternalType('int', $img->width); $this->assertInternalType('int', $img->height); $this->assertEquals($img->width, 800); - $this->assertEquals($img->height, 600); + $this->assertEquals($img->height, 600); // test dominant width for auto-resizing $img = $this->getTestImage(); @@ -88,7 +88,7 @@ class ImageTest extends PHPUnit_Framework_Testcase $this->assertInternalType('int', $img->width); $this->assertInternalType('int', $img->height); $this->assertEquals($img->width, 1000); - $this->assertEquals($img->height, 750); + $this->assertEquals($img->height, 750); // Test image upsizing. $img = $this->getTestImage();