From: Tim Otten Date: Tue, 25 Jul 2023 01:23:14 +0000 (-0700) Subject: Civi\Core\Url - Also support JSON serialization X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=794c107a4faa9cc0560f23fe1eec938b2a29fa5b;p=civicrm-core.git Civi\Core\Url - Also support JSON serialization --- 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 !== '') {