Skip to content

Commit 51d96f5

Browse files
Merge branch '3.4' into 4.2
* 3.4: Prevent destructors with side-effects from being unserialized
2 parents 517e41b + c31a91b commit 51d96f5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Tests/Kernel/ConcreteMicroKernel.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@ public function getLogDir()
6464
return $this->cacheDir;
6565
}
6666

67+
public function __sleep()
68+
{
69+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
70+
}
71+
72+
public function __wakeup()
73+
{
74+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
75+
}
76+
6777
public function __destruct()
6878
{
6979
$fs = new Filesystem();

0 commit comments

Comments
 (0)