Skip to content

Commit 4db1243

Browse files
committed
fix(dav): Adapt code to support PHP 7.4 for stable25
Signed-off-by: Côme Chilliet <[email protected]>
1 parent e548062 commit 4db1243

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

apps/dav/lib/DAV/CustomPropertiesBackend.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,12 +447,12 @@ private function encodeValueForDatabase(string $name, $value): array {
447447
"Property \"$name\" has an invalid value of type " . gettype($value),
448448
);
449449
} else {
450-
if (!str_starts_with($value::class, 'Sabre\\DAV\\Xml\\Property\\')
451-
&& !str_starts_with($value::class, 'Sabre\\CalDAV\\Xml\\Property\\')
452-
&& !str_starts_with($value::class, 'Sabre\\CardDAV\\Xml\\Property\\')
453-
&& !str_starts_with($value::class, 'OCA\\DAV\\')) {
450+
if (!str_starts_with(get_class($value), 'Sabre\\DAV\\Xml\\Property\\')
451+
&& !str_starts_with(get_class($value), 'Sabre\\CalDAV\\Xml\\Property\\')
452+
&& !str_starts_with(get_class($value), 'Sabre\\CardDAV\\Xml\\Property\\')
453+
&& !str_starts_with(get_class($value), 'OCA\\DAV\\')) {
454454
throw new DavException(
455-
"Property \"$name\" has an invalid value of class " . $value::class,
455+
"Property \"$name\" has an invalid value of class " . get_class($value),
456456
);
457457
}
458458
}
@@ -465,7 +465,7 @@ private function encodeValueForDatabase(string $name, $value): array {
465465
/**
466466
* @return mixed|Complex|string
467467
*/
468-
private function decodeValueFromDatabase(string $value, int $valueType): mixed {
468+
private function decodeValueFromDatabase(string $value, int $valueType) {
469469
switch ($valueType) {
470470
case self::PROPERTY_TYPE_XML:
471471
return new Complex($value);

0 commit comments

Comments
 (0)