diff options
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/Controller/OutOfOfficeController.php | 10 | ||||
-rw-r--r-- | apps/dav/lib/Db/Absence.php | 8 | ||||
-rw-r--r-- | apps/dav/lib/ResponseDefinitions.php | 4 | ||||
-rw-r--r-- | apps/dav/lib/Service/AbsenceService.php | 4 |
4 files changed, 13 insertions, 13 deletions
diff --git a/apps/dav/lib/Controller/OutOfOfficeController.php b/apps/dav/lib/Controller/OutOfOfficeController.php index b77b77f4b5e..4978fb87737 100644 --- a/apps/dav/lib/Controller/OutOfOfficeController.php +++ b/apps/dav/lib/Controller/OutOfOfficeController.php @@ -105,8 +105,8 @@ class OutOfOfficeController extends OCSController { * @param string $lastDay Last day of the absence in format `YYYY-MM-DD` * @param string $status Short text that is set as user status during the absence * @param string $message Longer multiline message that is shown to others during the absence - * @param string $replacementUserId User id of the replacement user - * @param string $replacementUserDisplayName Display name of the replacement user + * @param ?string $replacementUserId User id of the replacement user + * @param ?string $replacementUserDisplayName Display name of the replacement user * @return DataResponse<Http::STATUS_OK, DAVOutOfOfficeData, array{}>|DataResponse<Http::STATUS_BAD_REQUEST, array{error: 'firstDay'}, array{}>|DataResponse<Http::STATUS_UNAUTHORIZED, null, array{}>|DataResponse<Http::STATUS_NOT_FOUND, null, array{}> * * 200: Absence data @@ -120,8 +120,8 @@ class OutOfOfficeController extends OCSController { string $lastDay, string $status, string $message, - string $replacementUserId = '', - string $replacementUserDisplayName = '' + ?string $replacementUserId, + ?string $replacementUserDisplayName ): DataResponse { $user = $this->userSession?->getUser(); @@ -129,7 +129,7 @@ class OutOfOfficeController extends OCSController { return new DataResponse(null, Http::STATUS_UNAUTHORIZED); } - if ($replacementUserId !== '') { + if ($replacementUserId !== null) { $replacementUser = $this->userManager->get($replacementUserId); if ($replacementUser === null) { return new DataResponse(null, Http::STATUS_NOT_FOUND); diff --git a/apps/dav/lib/Db/Absence.php b/apps/dav/lib/Db/Absence.php index c58593e3e3f..550958aaabd 100644 --- a/apps/dav/lib/Db/Absence.php +++ b/apps/dav/lib/Db/Absence.php @@ -30,9 +30,9 @@ use OCP\User\IOutOfOfficeData; * @method string getMessage() * @method void setMessage(string $message) * @method string getReplacementUserId() - * @method void setReplacementUserId(string $replacementUserId) + * @method void setReplacementUserId(?string $replacementUserId) * @method string getReplacementUserDisplayName() - * @method void setReplacementUserDisplayName(string $replacementUserDisplayName) + * @method void setReplacementUserDisplayName(?string $replacementUserDisplayName) */ class Absence extends Entity implements JsonSerializable { protected string $userId = ''; @@ -47,9 +47,9 @@ class Absence extends Entity implements JsonSerializable { protected string $message = ''; - protected string $replacementUserId = ''; + protected ?string $replacementUserId = null; - protected string $replacementUserDisplayName = ''; + protected ?string $replacementUserDisplayName = null; public function __construct() { $this->addType('userId', 'string'); diff --git a/apps/dav/lib/ResponseDefinitions.php b/apps/dav/lib/ResponseDefinitions.php index 467c9a7b8bb..2dc0d4e8dbd 100644 --- a/apps/dav/lib/ResponseDefinitions.php +++ b/apps/dav/lib/ResponseDefinitions.php @@ -13,8 +13,8 @@ namespace OCA\DAV; * @psalm-type DAVOutOfOfficeDataCommon = array{ * userId: string, * message: string, - * replacementUserId: string, - * replacementUserDisplayName: string, + * replacementUserId: ?string, + * replacementUserDisplayName: ?string, * } * * @psalm-type DAVOutOfOfficeData = DAVOutOfOfficeDataCommon&array{ diff --git a/apps/dav/lib/Service/AbsenceService.php b/apps/dav/lib/Service/AbsenceService.php index 91e0b538c43..7cbc0386d43 100644 --- a/apps/dav/lib/Service/AbsenceService.php +++ b/apps/dav/lib/Service/AbsenceService.php @@ -61,8 +61,8 @@ class AbsenceService { $absence->setLastDay($lastDay); $absence->setStatus($status); $absence->setMessage($message); - $absence->setReplacementUserId($replacementUserId ?? ''); - $absence->setReplacementUserDisplayName($replacementUserDisplayName ?? ''); + $absence->setReplacementUserId($replacementUserId); + $absence->setReplacementUserDisplayName($replacementUserDisplayName); if ($absence->getId() === null) { $absence = $this->absenceMapper->insert($absence); |