From 35444b249e7481b940af0c6635f78792e4006819 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Sun, 22 May 2022 11:25:08 +0200 Subject: [PATCH] Change signature of Frame::setCore --- src/Drivers/Abstract/AbstractFrame.php | 17 ++++++++++++++++- src/Drivers/Gd/Frame.php | 7 ------- src/Drivers/Imagick/Frame.php | 7 ------- src/Interfaces/FrameInterface.php | 1 + 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/Drivers/Abstract/AbstractFrame.php b/src/Drivers/Abstract/AbstractFrame.php index c83c8af3..223a2072 100644 --- a/src/Drivers/Abstract/AbstractFrame.php +++ b/src/Drivers/Abstract/AbstractFrame.php @@ -4,5 +4,20 @@ namespace Intervention\Image\Drivers\Abstract; abstract class AbstractFrame { - // + /** + * Set the frame core + * + * Input is losely typed and depending on the driver. + * Might be GdImage or Imagick but should be open to + * add more drivers. + * + * @param mixed $core + * @return AbstractFrame + */ + public function setCore($core): self + { + $this->core = $core; + + return $this; + } } diff --git a/src/Drivers/Gd/Frame.php b/src/Drivers/Gd/Frame.php index ea33a036..6f43945d 100644 --- a/src/Drivers/Gd/Frame.php +++ b/src/Drivers/Gd/Frame.php @@ -27,13 +27,6 @@ class Frame extends AbstractFrame implements FrameInterface return $this->core; } - public function setCore(GdImage $core): self - { - $this->core = $core; - - return $this; - } - public function unsetCore(): void { unset($this->core); diff --git a/src/Drivers/Imagick/Frame.php b/src/Drivers/Imagick/Frame.php index 632ad2c7..94cc9c68 100644 --- a/src/Drivers/Imagick/Frame.php +++ b/src/Drivers/Imagick/Frame.php @@ -22,13 +22,6 @@ class Frame extends AbstractFrame implements FrameInterface return $this->core; } - public function setCore(Imagick $core): FrameInterface - { - $this->core = $core; - - return $this; - } - public function getSize(): SizeInterface { return new Size($this->core->getImageWidth(), $this->core->getImageHeight()); diff --git a/src/Interfaces/FrameInterface.php b/src/Interfaces/FrameInterface.php index 3c27aea9..b2fd1230 100644 --- a/src/Interfaces/FrameInterface.php +++ b/src/Interfaces/FrameInterface.php @@ -6,6 +6,7 @@ interface FrameInterface { public function toImage(): ImageInterface; public function getCore(); + public function setCore($core): FrameInterface; public function getSize(): SizeInterface; public function getDelay(): float; public function setDelay(float $delay): FrameInterface;