From 240ff2124a16dad3abfa0bc8ec740ec66c8186d3 Mon Sep 17 00:00:00 2001 From: "E.Alamo" Date: Wed, 29 Oct 2025 11:50:45 +0100 Subject: [PATCH] Fix serialization in child classes Current visibility of properties $email and $charset (private) limits the ability to serialize any inherited class, since __sleep(), when is called in a subclass, cannot access those properties and thus serialization is missing the most important part of class, the email. Changing $email and $charset to protected addresses this. --- src/Message.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Message.php b/src/Message.php index f8cf094..094fa5d 100644 --- a/src/Message.php +++ b/src/Message.php @@ -30,8 +30,8 @@ */ class Message extends BaseMessage implements MessageWrapperInterface { - private Email $email; - private string $charset = 'utf-8'; + protected Email $email; + protected string $charset = 'utf-8'; /** * @param array $config