From 3bd86a9084a745f3281bdf828d8f511d24cd108a Mon Sep 17 00:00:00 2001 From: Michael Schlueter Date: Tue, 11 Apr 2023 21:15:46 +0200 Subject: [PATCH 1/2] fixed deprecate warning with PHP8.1 for kronolith --- lib/Attendee.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/Attendee.php b/lib/Attendee.php index e006d1a74..7ee62e428 100644 --- a/lib/Attendee.php +++ b/lib/Attendee.php @@ -231,24 +231,32 @@ public function toJson() */ public function serialize() { - return serialize(array( + return array_shift($this->__serialize()); + } + public function __serialize(): array + { + return [ 'u' => $this->user, 'e' => $this->email, 'p' => $this->role, 'r' => $this->response, 'n' => $this->name, - )); + ] } /** */ public function unserialize($data) { - $data = @unserialize($data); + $this->__unserialize([$data]); + + } + public function __unserialize(array $data): void + { $this->user = $data['u']; $this->email = $data['e']; $this->role = $data['p']; $this->response = $data['r']; $this->name = $data['n']; } -} +} From 99c84983e414ceff5841c408cd879fa03349d31e Mon Sep 17 00:00:00 2001 From: Michael Schlueter Date: Tue, 11 Apr 2023 23:03:38 +0200 Subject: [PATCH 2/2] Fix for __serialize --- lib/Attendee.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Attendee.php b/lib/Attendee.php index 7ee62e428..0c5e6f3c7 100644 --- a/lib/Attendee.php +++ b/lib/Attendee.php @@ -241,7 +241,7 @@ public function __serialize(): array 'p' => $this->role, 'r' => $this->response, 'n' => $this->name, - ] + ]; } /**