From caf664ea438adea76a9b8e8ed19dad04f76de767 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 ae77498539b..00065d49b17 100644 --- a/apps/dav/lib/CardDAV/AddressBookImpl.php +++ b/apps/dav/lib/CardDAV/AddressBookImpl.php @@ -41,7 +41,7 @@ class AddressBookImpl implements IAddressBookEnabled { * @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 74699cf3925..77b5db309df 100644 --- a/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php +++ b/apps/dav/tests/unit/CardDAV/AddressBookImplTest.php @@ -53,7 +53,8 @@ class AddressBookImplTest extends TestCase { } public function testGetKey(): void { - $this->assertSame($this->addressBookInfo['id'], + $this->assertIsString($this->addressBookImpl->getKey()); + $this->assertSame((string)$this->addressBookInfo['id'], $this->addressBookImpl->getKey()); }