A better error message for Server::getInstance() access on other threads

This commit is contained in:
SOFe 2017-11-05 18:40:47 +08:00 committed by GitHub
parent 20d2ef9d38
commit 34d2047ac3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1407,6 +1407,9 @@ class Server{
* @return Server
*/
public static function getInstance() : Server{
if(self::$instance === null){
throw new \RuntimeException("Attempt to retrieve Server instance outside server thread");
}
return self::$instance;
}