From af5f8f0a43dc410467ab8582f70e2f456ba338bb Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Thu, 26 Oct 2023 16:22:41 +0200 Subject: [PATCH] Rename method - ImageInterface::getLoops to ImageInterface::loops --- src/Drivers/Gd/Encoders/GifEncoder.php | 2 +- src/Drivers/Gd/Image.php | 2 +- src/Drivers/Imagick/Image.php | 2 +- src/Interfaces/ImageInterface.php | 2 +- tests/Drivers/Gd/ImageTest.php | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Drivers/Gd/Encoders/GifEncoder.php b/src/Drivers/Gd/Encoders/GifEncoder.php index b01fdd03..6f258982 100644 --- a/src/Drivers/Gd/Encoders/GifEncoder.php +++ b/src/Drivers/Gd/Encoders/GifEncoder.php @@ -28,7 +28,7 @@ class GifEncoder extends AbstractEncoder implements EncoderInterface $builder = GifBuilder::canvas( $image->width(), $image->height(), - $image->getLoops() + $image->loops() ); foreach ($image as $frame) { diff --git a/src/Drivers/Gd/Image.php b/src/Drivers/Gd/Image.php index 6b24619d..c2887c7c 100644 --- a/src/Drivers/Gd/Image.php +++ b/src/Drivers/Gd/Image.php @@ -40,7 +40,7 @@ class Image extends AbstractImage implements ImageInterface, IteratorAggregate return $this->count() > 1; } - public function getLoops(): int + public function loops(): int { return $this->loops; } diff --git a/src/Drivers/Imagick/Image.php b/src/Drivers/Imagick/Image.php index a83d9a67..74f5ebfd 100644 --- a/src/Drivers/Imagick/Image.php +++ b/src/Drivers/Imagick/Image.php @@ -76,7 +76,7 @@ class Image extends AbstractImage implements ImageInterface, Iterator return $this; } - public function getLoops(): int + public function loops(): int { return $this->imagick->getImageIterations(); } diff --git a/src/Interfaces/ImageInterface.php b/src/Interfaces/ImageInterface.php index b09ef526..a981cfbb 100644 --- a/src/Interfaces/ImageInterface.php +++ b/src/Interfaces/ImageInterface.php @@ -46,7 +46,7 @@ interface ImageInterface extends Traversable, Countable * * @return int */ - public function getLoops(): int; + public function loops(): int; /** * Return size of current image diff --git a/tests/Drivers/Gd/ImageTest.php b/tests/Drivers/Gd/ImageTest.php index 26a7c344..96b2fd6b 100644 --- a/tests/Drivers/Gd/ImageTest.php +++ b/tests/Drivers/Gd/ImageTest.php @@ -70,9 +70,9 @@ class ImageTest extends TestCase public function testSetGetLoops(): void { - $this->assertEquals(0, $this->image->getLoops()); + $this->assertEquals(0, $this->image->loops()); $result = $this->image->setLoops(12); - $this->assertEquals(12, $this->image->getLoops()); + $this->assertEquals(12, $this->image->loops()); $this->assertInstanceOf(Image::class, $result); }