From 06ab1f2d14ddd4a4d23b9a6b435d122a582e5099 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Tue, 26 Aug 2025 12:33:41 +0200 Subject: [PATCH] fix(carddav): IAddressBook::getKey() should return a string Signed-off-by: Richard Steinmetz --- apps/dav/lib/CardDAV/AddressBookImpl.php | 2 +- apps/dav/tests/unit/CardDAV/AddressBookImplTest.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/dav/lib/CardDAV/AddressBookImpl.php b/apps/dav/lib/CardDAV/AddressBookImpl.php index 11610a5a81549..034db1ee2ddbc 100644 --- a/apps/dav/lib/CardDAV/AddressBookImpl.php +++ b/apps/dav/lib/CardDAV/AddressBookImpl.php @@ -41,7 +41,7 @@ public function __construct( * @since 5.0.0 */ public function getKey() { - return $this->addressBookInfo['id']; + return (string)$this->addressBookInfo['id']; } /** diff --git a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php index 747a4b86338ad..101b674c37aaa 100644 --- a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php +++ b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php @@ -67,7 +67,8 @@ protected function setUp(): void { } public function testGetKey(): void { - $this->assertSame($this->addressBookInfo['id'], + $this->assertIsString($this->addressBookImpl->getKey()); + $this->assertSame((string)$this->addressBookInfo['id'], $this->addressBookImpl->getKey()); }