Skip to content

Commit 033b956

Browse files
author
Robert Kujawa
authored
Remove __sleep & __wakeup from SerializesModels (#44847)
1 parent c76c3bd commit 033b956

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

src/Illuminate/Queue/SerializesModels.php

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,6 @@ trait SerializesModels
99
{
1010
use SerializesAndRestoresModelIdentifiers;
1111

12-
/**
13-
* Prepare the instance for serialization.
14-
*
15-
* @return array
16-
*/
17-
public function __sleep()
18-
{
19-
$properties = (new ReflectionClass($this))->getProperties();
20-
21-
foreach ($properties as $property) {
22-
$property->setValue($this, $this->getSerializedPropertyValue(
23-
$this->getPropertyValue($property)
24-
));
25-
}
26-
27-
return array_values(array_filter(array_map(function ($p) {
28-
return $p->isStatic() ? null : $p->getName();
29-
}, $properties)));
30-
}
31-
32-
/**
33-
* Restore the model after serialization.
34-
*
35-
* @return void
36-
*/
37-
public function __wakeup()
38-
{
39-
foreach ((new ReflectionClass($this))->getProperties() as $property) {
40-
if ($property->isStatic()) {
41-
continue;
42-
}
43-
44-
$property->setValue($this, $this->getRestoredPropertyValue(
45-
$this->getPropertyValue($property)
46-
));
47-
}
48-
}
49-
5012
/**
5113
* Prepare the instance values for serialization.
5214
*

0 commit comments

Comments
 (0)