/**
* User
*/
-class User implements UserInterface, PasswordAuthenticatedUserInterface, \Serializable {
+class User implements UserInterface, PasswordAuthenticatedUserInterface {
/**
* @var integer
*/
*
* @param ?string $mail The user mail
*/
- public function __construct(?string $mail) {
+ public function __construct(?string $mail = null) {
//With mail
if ($mail !== null && !empty($mail)) {
$this->mail = $mail;
/**
* {@inheritdoc}
*/
- public function serialize(): string {
- return serialize([
+ public function __serialize(): array {
+ return [
$this->id,
$this->mail,
$this->forename,
$this->disabled,
$this->created,
$this->updated
- ]);
+ ];
}
/**
* {@inheritdoc}
*/
- public function unserialize($serialized) {
+ public function __unserialize(array $data): void {
list(
$this->id,
$this->mail,
$this->disabled,
$this->created,
$this->updated
- ) = unserialize($serialized);
+ ) = $data;
}
/**