From 21b237fd1d24517557f5771e0f2dc6f78a2a19d2 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 fd42447f0e539..186f81d172d25 100644 --- a/apps/dav/lib/CardDAV/AddressBookImpl.php +++ b/apps/dav/lib/CardDAV/AddressBookImpl.php @@ -66,7 +66,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 038bc0274d9dc..f9563991af23a 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()); }