From 4db1243717e62e9beacceda1827ddec5ae6237e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 20 Oct 2025 12:22:24 +0200 Subject: [PATCH] fix(dav): Adapt code to support PHP 7.4 for stable25 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/dav/lib/DAV/CustomPropertiesBackend.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/dav/lib/DAV/CustomPropertiesBackend.php b/apps/dav/lib/DAV/CustomPropertiesBackend.php index 8b408b09cf3..2ea18f3558d 100644 --- a/apps/dav/lib/DAV/CustomPropertiesBackend.php +++ b/apps/dav/lib/DAV/CustomPropertiesBackend.php @@ -447,12 +447,12 @@ class CustomPropertiesBackend implements BackendInterface { "Property \"$name\" has an invalid value of type " . gettype($value), ); } else { - if (!str_starts_with($value::class, 'Sabre\\DAV\\Xml\\Property\\') - && !str_starts_with($value::class, 'Sabre\\CalDAV\\Xml\\Property\\') - && !str_starts_with($value::class, 'Sabre\\CardDAV\\Xml\\Property\\') - && !str_starts_with($value::class, 'OCA\\DAV\\')) { + if (!str_starts_with(get_class($value), 'Sabre\\DAV\\Xml\\Property\\') + && !str_starts_with(get_class($value), 'Sabre\\CalDAV\\Xml\\Property\\') + && !str_starts_with(get_class($value), 'Sabre\\CardDAV\\Xml\\Property\\') + && !str_starts_with(get_class($value), 'OCA\\DAV\\')) { throw new DavException( - "Property \"$name\" has an invalid value of class " . $value::class, + "Property \"$name\" has an invalid value of class " . get_class($value), ); } } @@ -465,7 +465,7 @@ class CustomPropertiesBackend implements BackendInterface { /** * @return mixed|Complex|string */ - private function decodeValueFromDatabase(string $value, int $valueType): mixed { + private function decodeValueFromDatabase(string $value, int $valueType) { switch ($valueType) { case self::PROPERTY_TYPE_XML: return new Complex($value);