From b603d29ffdeb616b7b83a0662e706027527746ad Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sun, 18 May 2014 11:50:32 +0200 Subject: [PATCH] changed argument order of circle() and ellipse() --- src/Intervention/Image/Commands/CircleCommand.php | 6 +++--- src/Intervention/Image/Commands/EllipseCommand.php | 8 ++++---- tests/CircleCommandTest.php | 4 ++-- tests/EllipseCommandTest.php | 4 ++-- tests/GdSystemTest.php | 4 ++-- tests/ImagickSystemTest.php | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Intervention/Image/Commands/CircleCommand.php b/src/Intervention/Image/Commands/CircleCommand.php index 438c93a6..b047e4a5 100644 --- a/src/Intervention/Image/Commands/CircleCommand.php +++ b/src/Intervention/Image/Commands/CircleCommand.php @@ -14,9 +14,9 @@ class CircleCommand extends \Intervention\Image\Commands\AbstractCommand */ public function execute($image) { - $x = $this->argument(0)->type('numeric')->required()->value(); - $y = $this->argument(1)->type('numeric')->required()->value(); - $radius = $this->argument(2)->type('numeric')->required()->value(); + $radius = $this->argument(0)->type('numeric')->required()->value(); + $x = $this->argument(1)->type('numeric')->required()->value(); + $y = $this->argument(2)->type('numeric')->required()->value(); $callback = $this->argument(3)->type('closure')->value(); $circle_classname = sprintf('\Intervention\Image\%s\Shapes\CircleShape', diff --git a/src/Intervention/Image/Commands/EllipseCommand.php b/src/Intervention/Image/Commands/EllipseCommand.php index 02d99642..d482071e 100644 --- a/src/Intervention/Image/Commands/EllipseCommand.php +++ b/src/Intervention/Image/Commands/EllipseCommand.php @@ -14,10 +14,10 @@ class EllipseCommand extends \Intervention\Image\Commands\AbstractCommand */ public function execute($image) { - $x = $this->argument(0)->type('numeric')->required()->value(); - $y = $this->argument(1)->type('numeric')->required()->value(); - $width = $this->argument(2)->type('numeric')->value(10); - $height = $this->argument(3)->type('numeric')->value(10); + $width = $this->argument(0)->type('numeric')->required()->value(); + $height = $this->argument(1)->type('numeric')->required()->value(); + $x = $this->argument(2)->type('numeric')->required()->value(); + $y = $this->argument(3)->type('numeric')->required()->value(); $callback = $this->argument(4)->type('closure')->value(); $ellipse_classname = sprintf('\Intervention\Image\%s\Shapes\EllipseShape', diff --git a/tests/CircleCommandTest.php b/tests/CircleCommandTest.php index 7d816a15..241440ec 100644 --- a/tests/CircleCommandTest.php +++ b/tests/CircleCommandTest.php @@ -17,7 +17,7 @@ class CircleCommandTest extends PHPUnit_Framework_TestCase $image = Mockery::mock('\Intervention\Image\Image'); $image->shouldReceive('getDriver')->once()->andReturn($driver); $image->shouldReceive('getCore')->once()->andReturn($resource); - $command = new CircleCommand(array(10, 20, 250)); + $command = new CircleCommand(array(250, 10, 20)); $result = $command->execute($image); $this->assertTrue($result); $this->assertFalse($command->hasOutput()); @@ -33,7 +33,7 @@ class CircleCommandTest extends PHPUnit_Framework_TestCase $image->shouldReceive('getDriver')->once()->andReturn($driver); $image->shouldReceive('getCore')->once()->andReturn($imagick); - $command = new CircleCommand(array(10, 20, 250)); + $command = new CircleCommand(array(25, 10, 20)); $result = $command->execute($image); $this->assertTrue($result); $this->assertFalse($command->hasOutput()); diff --git a/tests/EllipseCommandTest.php b/tests/EllipseCommandTest.php index 68de6f57..8ac42e00 100644 --- a/tests/EllipseCommandTest.php +++ b/tests/EllipseCommandTest.php @@ -17,7 +17,7 @@ class EllipseCommandTest extends PHPUnit_Framework_TestCase $image = Mockery::mock('\Intervention\Image\Image'); $image->shouldReceive('getDriver')->once()->andReturn($driver); $image->shouldReceive('getCore')->once()->andReturn($resource); - $command = new EllipseCommand(array(10, 20, 250, 150)); + $command = new EllipseCommand(array(250, 150, 10, 20)); $result = $command->execute($image); $this->assertTrue($result); $this->assertFalse($command->hasOutput()); @@ -33,7 +33,7 @@ class EllipseCommandTest extends PHPUnit_Framework_TestCase $image->shouldReceive('getDriver')->once()->andReturn($driver); $image->shouldReceive('getCore')->once()->andReturn($imagick); - $command = new EllipseCommand(array(10, 20, 250, 150)); + $command = new EllipseCommand(array(250, 150, 10, 20)); $result = $command->execute($image); $this->assertTrue($result); $this->assertFalse($command->hasOutput()); diff --git a/tests/GdSystemTest.php b/tests/GdSystemTest.php index 4076c36f..57b76c7f 100644 --- a/tests/GdSystemTest.php +++ b/tests/GdSystemTest.php @@ -1002,14 +1002,14 @@ class GdSystemTest extends PHPUnit_Framework_TestCase public function testEllipseImage() { $img = $this->manager()->canvas(16, 16, 'ffffff'); - $img->ellipse(8, 8, 12, 8, function ($draw) { $draw->background('#ff0000'); $draw->border(1, '#0000ff'); }); + $img->ellipse(12, 8, 8, 8, function ($draw) { $draw->background('#ff0000'); $draw->border(1, '#0000ff'); }); $this->assertEquals('d56363fd454ad6e25a23c2a4a7c77998', $img->checksum()); } public function testCircleImage() { $img = $this->manager()->canvas(16, 16, 'ffffff'); - $img->circle(8, 8, 12, function ($draw) { $draw->background('#ff0000'); $draw->border(1, '#0000ff'); }); + $img->circle(12, 8, 8, function ($draw) { $draw->background('#ff0000'); $draw->border(1, '#0000ff'); }); $this->assertEquals('c214f58de03d171f7f278a7b957bab50', $img->checksum()); } diff --git a/tests/ImagickSystemTest.php b/tests/ImagickSystemTest.php index 75310fd1..21adc2df 100644 --- a/tests/ImagickSystemTest.php +++ b/tests/ImagickSystemTest.php @@ -975,14 +975,14 @@ class ImagickSystemTest extends PHPUnit_Framework_TestCase public function testEllipseImage() { $img = $this->manager()->canvas(16, 16, 'ffffff'); - $img->ellipse(8, 8, 12, 8, function ($draw) { $draw->background('#ff0000'); $draw->border(1, '#0000ff'); }); + $img->ellipse(12, 8, 8, 8, function ($draw) { $draw->background('#ff0000'); $draw->border(1, '#0000ff'); }); $this->assertEquals('9dc5bbec6d45868610c082a1d67640b5', $img->checksum()); } public function testCircleImage() { $img = $this->manager()->canvas(16, 16, 'ffffff'); - $img->circle(8, 8, 12, function ($draw) { $draw->background('#ff0000'); $draw->border(1, '#0000ff'); }); + $img->circle(12, 8, 8, function ($draw) { $draw->background('#ff0000'); $draw->border(1, '#0000ff'); }); $this->assertEquals('a433c7c1a842ef83e1cb45875371358c', $img->checksum()); }