mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 00:25:04 +00:00
Apply typehints to all AsyncTask methods
Since we're breaking API here anyway, no point in holding back on this.
This commit is contained in:
@ -39,7 +39,7 @@ class AsyncTaskMainLoggerTest extends Test{
|
||||
$this->storeLocal($testObject);
|
||||
}
|
||||
|
||||
public function onRun(){
|
||||
public function onRun() : void{
|
||||
ob_start();
|
||||
MainLogger::getLogger()->info("Testing");
|
||||
if(strpos(ob_get_contents(), "Testing") !== false){
|
||||
@ -48,7 +48,7 @@ class AsyncTaskMainLoggerTest extends Test{
|
||||
ob_end_flush();
|
||||
}
|
||||
|
||||
public function onCompletion(){
|
||||
public function onCompletion() : void{
|
||||
/** @var AsyncTaskMainLoggerTest $test */
|
||||
$test = $this->fetchLocal();
|
||||
$test->setResult($this->success ? Test::RESULT_OK : Test::RESULT_FAILED);
|
||||
|
@ -50,7 +50,7 @@ class AsyncTaskMemoryLeakTest extends Test{
|
||||
class TestAsyncTask extends AsyncTask{
|
||||
public static $destroyed = false;
|
||||
|
||||
public function onRun(){
|
||||
public function onRun() : void{
|
||||
usleep(50 * 1000); //1 server tick
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user