diff --git a/src/Symfony/Component/Semaphore/Semaphore.php b/src/Symfony/Component/Semaphore/Semaphore.php index a65e2bc289..572b5f16ce 100644 --- a/src/Symfony/Component/Semaphore/Semaphore.php +++ b/src/Symfony/Component/Semaphore/Semaphore.php @@ -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. */