From 794c107a4faa9cc0560f23fe1eec938b2a29fa5b Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 24 Jul 2023 18:23:14 -0700 Subject: [PATCH] Civi\Core\Url - Also support JSON serialization --- Civi/Core/Url.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Civi/Core/Url.php b/Civi/Core/Url.php index da014967ff..69ab20db08 100644 --- a/Civi/Core/Url.php +++ b/Civi/Core/Url.php @@ -33,7 +33,7 @@ namespace Civi\Core; * This cl * @see \Civi::url() */ -final class Url { +final class Url implements \JsonSerializable { /** * @var string @@ -560,6 +560,11 @@ final class Url { return $this->htmlEscape ? htmlentities($result) : $result; } + #[\ReturnTypeWillChange] + public function jsonSerialize() { + return $this->__toString(); + } + private function composeSuffix(): string { $result = ''; if ($this->query !== NULL && $this->query !== '') { -- 2.25.1