You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 7.3:
Replace __sleep/wakeup() by __(un)serialize() for throwing and internal usages
[TypeInfo] simplify identifier comparison in isIdentifiedBy method
Copy file name to clipboardExpand all lines: Part/MessagePart.php
+2-65Lines changed: 2 additions & 65 deletions
Original file line number
Diff line number
Diff line change
@@ -59,75 +59,12 @@ public function bodyToIterable(): iterable
59
59
60
60
publicfunction__serialize(): array
61
61
{
62
-
if (self::class === (new \ReflectionMethod($this, '__sleep'))->class || self::class !== (new \ReflectionMethod($this, '__serialize'))->class) {
63
-
return ['message' => $this->message];
64
-
}
65
-
66
-
trigger_deprecation('symfony/mime', '7.4', 'Implementing "%s::__sleep()" is deprecated, use "__serialize()" instead.', get_debug_type($this));
67
-
68
-
$data = [];
69
-
foreach ($this->__sleep() as$key) {
70
-
try {
71
-
if (($r = new \ReflectionProperty($this, $key))->isInitialized($this)) {
72
-
$data[$key] = $r->getValue($this);
73
-
}
74
-
} catch (\ReflectionException) {
75
-
$data[$key] = $this->$key;
76
-
}
77
-
}
78
-
79
-
return$data;
62
+
return ['message' => $this->message];
80
63
}
81
64
82
65
publicfunction__unserialize(array$data): void
83
66
{
84
-
if ($wakeup = self::class !== (new \ReflectionMethod($this, '__wakeup'))->class && self::class === (new \ReflectionMethod($this, '__unserialize'))->class) {
85
-
trigger_deprecation('symfony/mime', '7.4', 'Implementing "%s::__wakeup()" is deprecated, use "__unserialize()" instead.', get_debug_type($this));
86
-
}
87
-
88
-
if (\in_array(array_keys($data), [['message'], ["\0".self::class."\0message"]], true)) {
trigger_deprecation('symfony/mime', '7.4', 'Passing more than just key "message" to "%s::__unserialize()" is deprecated, populate properties in "%s::__unserialize()" instead.', self::class, get_debug_type($this));
0 commit comments