[Semaphore] Dont allow unserializing classes with a destructor
This commit is contained in:
parent
2052534540
commit
92a2afb694
@ -48,6 +48,16 @@ final class Semaphore implements SemaphoreInterface, LoggerAwareInterface
|
||||
$this->logger = new NullLogger();
|
||||
}
|
||||
|
||||
public function __sleep()
|
||||
{
|
||||
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
|
||||
}
|
||||
|
||||
public function __wakeup()
|
||||
{
|
||||
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
|
||||
}
|
||||
|
||||
/**
|
||||
* Automatically releases the underlying semaphore when the object is destructed.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user