mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
More nullable and void typehints
This commit is contained in:
@ -39,7 +39,7 @@ abstract class Thread extends \Thread{
|
||||
return $this->classLoader;
|
||||
}
|
||||
|
||||
public function setClassLoader(?\ClassLoader $loader = null){
|
||||
public function setClassLoader(?\ClassLoader $loader = null) : void{
|
||||
$this->composerAutoloaderPath = \pocketmine\COMPOSER_AUTOLOADER_PATH;
|
||||
|
||||
if($loader === null){
|
||||
@ -55,7 +55,7 @@ abstract class Thread extends \Thread{
|
||||
* If you do not do this, you will not be able to use new classes that were not loaded when the thread was started
|
||||
* (unless you are using a custom autoloader).
|
||||
*/
|
||||
public function registerClassLoader(){
|
||||
public function registerClassLoader() : void{
|
||||
if($this->composerAutoloaderPath !== null){
|
||||
require $this->composerAutoloaderPath;
|
||||
}
|
||||
@ -64,7 +64,7 @@ abstract class Thread extends \Thread{
|
||||
}
|
||||
}
|
||||
|
||||
public function start(?int $options = \PTHREADS_INHERIT_ALL){
|
||||
public function start(?int $options = \PTHREADS_INHERIT_ALL) : bool{
|
||||
ThreadManager::getInstance()->add($this);
|
||||
|
||||
if($this->getClassLoader() === null){
|
||||
@ -76,7 +76,7 @@ abstract class Thread extends \Thread{
|
||||
/**
|
||||
* Stops the thread using the best way possible. Try to stop it yourself before calling this.
|
||||
*/
|
||||
public function quit(){
|
||||
public function quit() : void{
|
||||
$this->isKilled = true;
|
||||
|
||||
if(!$this->isJoined()){
|
||||
|
Reference in New Issue
Block a user