From f9b6691d70a6af3393900cb14f1b92c1c565bd10 Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Tue, 28 Feb 2023 20:33:51 +0100 Subject: [PATCH] Add wither to `ImageValue` to set a new URL. --- CHANGELOG.md | 6 ++++++ src/Data/Value/ImageValue.php | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66027cf..1f471f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +6.3.5 +===== + +* (improvement) Add wither to `ImageValue` to set a new URL. + + 6.3.4 ===== diff --git a/src/Data/Value/ImageValue.php b/src/Data/Value/ImageValue.php index 5ae0ec6..8764180 100644 --- a/src/Data/Value/ImageValue.php +++ b/src/Data/Value/ImageValue.php @@ -51,4 +51,18 @@ public function getCopyright () : ?string { return $this->copyright; } + + /** + * + */ + public function withNewUrl (string $url) : self + { + return new self( + $url, + $this->width, + $this->height, + $this->alt, + $this->copyright, + ); + } }