Throw an exception when something attempts to serialize Server (#459)

This commit is contained in:
Dylan K. Taylor 2017-03-25 10:33:05 +00:00 committed by GitHub
parent 5332887a0a
commit c9cf3d5aa4

View File

@ -2434,4 +2434,13 @@ class Server{
return true;
}
/**
* Called when something attempts to serialize the server instance.
*
* @throws \BadMethodCallException because Server instances cannot be serialized
*/
public function __sleep(){
throw new \BadMethodCallException("Cannot serialize Server instance");
}
}