From ee48fb9286da83dd2d29c368cf0490779a4fca3d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Mon, 3 Oct 2022 02:17:00 +0200 Subject: [PATCH] Implement Serializable interface --- Entity/User.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Entity/User.php b/Entity/User.php index 61be105..8103ea6 100644 --- a/Entity/User.php +++ b/Entity/User.php @@ -22,7 +22,7 @@ use Rapsys\UserBundle\Entity\Group; /** * User */ -class User implements UserInterface, PasswordAuthenticatedUserInterface, \Serializable { +class User implements UserInterface, PasswordAuthenticatedUserInterface { /** * @var integer */ @@ -435,8 +435,8 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, \Serial /** * {@inheritdoc} */ - public function serialize(): string { - return serialize([ + public function __serialize(): array { + return [ $this->id, $this->mail, $this->forename, @@ -446,13 +446,13 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, \Serial $this->disabled, $this->created, $this->updated - ]); + ]; } /** * {@inheritdoc} */ - public function unserialize($serialized) { + public function __unserialize(array $data): void { list( $this->id, $this->mail, @@ -463,7 +463,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, \Serial $this->disabled, $this->created, $this->updated - ) = unserialize($serialized); + ) = $data; } /** -- 2.41.1