1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-01 11:30:16 +02:00

Change signatures of ImageInterface

This commit is contained in:
Oliver Vogel
2022-06-16 09:18:08 +02:00
parent a8fa90cde9
commit ed12d374ff
2 changed files with 7 additions and 7 deletions

View File

@@ -6,6 +6,7 @@ use Intervention\Image\Collection;
use Intervention\Image\EncodedImage; use Intervention\Image\EncodedImage;
use Intervention\Image\Geometry\Point; use Intervention\Image\Geometry\Point;
use Intervention\Image\Geometry\Size; use Intervention\Image\Geometry\Size;
use Intervention\Image\Interfaces\CollectionInterface;
use Intervention\Image\Interfaces\EncoderInterface; use Intervention\Image\Interfaces\EncoderInterface;
use Intervention\Image\Interfaces\FrameInterface; use Intervention\Image\Interfaces\FrameInterface;
use Intervention\Image\Interfaces\ImageInterface; use Intervention\Image\Interfaces\ImageInterface;
@@ -24,12 +25,12 @@ abstract class AbstractImage implements ImageInterface
// //
} }
public function getIterator(): Collection public function getIterator(): CollectionInterface
{ {
return $this->frames; return $this->frames;
} }
public function getFrames(): Collection public function getFrames(): CollectionInterface
{ {
return $this->frames; return $this->frames;
} }
@@ -225,7 +226,7 @@ abstract class AbstractImage implements ImageInterface
); );
} }
public function pickColors(int $x, int $y): Collection public function pickColors(int $x, int $y): CollectionInterface
{ {
$colors = new Collection(); $colors = new Collection();
foreach ($this->getFrames() as $key => $frame) { foreach ($this->getFrames() as $key => $frame) {

View File

@@ -2,13 +2,12 @@
namespace Intervention\Image\Interfaces; namespace Intervention\Image\Interfaces;
use Intervention\Image\Collection;
use Intervention\Image\EncodedImage; use Intervention\Image\EncodedImage;
interface ImageInterface interface ImageInterface
{ {
public function getIterator(): Collection; public function getIterator(): CollectionInterface;
public function getFrames(): Collection; public function getFrames(): CollectionInterface;
public function getFrame(int $key = 0): ?FrameInterface; public function getFrame(int $key = 0): ?FrameInterface;
public function addFrame(FrameInterface $frame): ImageInterface; public function addFrame(FrameInterface $frame): ImageInterface;
public function setLoops(int $count): ImageInterface; public function setLoops(int $count): ImageInterface;
@@ -21,7 +20,7 @@ interface ImageInterface
public function toWebp(int $quality = 75): EncodedImage; public function toWebp(int $quality = 75): EncodedImage;
public function toGif(): EncodedImage; public function toGif(): EncodedImage;
public function toPng(): EncodedImage; public function toPng(): EncodedImage;
public function pickColors(int $x, int $y): Collection; public function pickColors(int $x, int $y): CollectionInterface;
public function pickColor(int $x, int $y, int $frame_key = 0): ?ColorInterface; public function pickColor(int $x, int $y, int $frame_key = 0): ?ColorInterface;
public function greyscale(): ImageInterface; public function greyscale(): ImageInterface;
public function blur(int $amount = 5): ImageInterface; public function blur(int $amount = 5): ImageInterface;