fix(dav): Adapt code to support PHP 7.4 for stable25

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2025-10-20 12:22:24 +02:00
parent e5480625c4
commit 4db1243717
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -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);