Modernize property type declarations

This commit is contained in:
Dylan K. Taylor
2022-06-04 18:16:32 +01:00
parent 23695fb900
commit 083a35f970
114 changed files with 431 additions and 863 deletions

View File

@@ -89,7 +89,7 @@ class Config{
private bool $changed = false;
/** @var int[] */
public static $formats = [
public static array $formats = [
"properties" => Config::PROPERTIES,
"cnf" => Config::CNF,
"conf" => Config::CNF,

View File

@@ -64,10 +64,8 @@ use const SOCK_DGRAM;
use const SOL_UDP;
class Internet{
/** @var string|false */
public static $ip = false;
/** @var bool */
public static $online = true;
public static string|false $ip = false;
public static bool $online = true;
/**
* Gets the External IP using an external service, it is cached

View File

@@ -32,8 +32,7 @@ use const PHP_EOL;
use const PTHREADS_INHERIT_NONE;
class MainLogger extends \AttachableThreadedLogger implements \BufferedLogger{
/** @var bool */
protected $logDebug;
protected bool $logDebug;
private string $format = TextFormat::AQUA . "[%s] " . TextFormat::RESET . "%s[%s/%s]: %s" . TextFormat::RESET;
private bool $useFormattingCodes = false;

View File

@@ -40,8 +40,7 @@ class Random{
private int $z;
private int $w;
/** @var int */
protected $seed;
protected int $seed;
/**
* @param int $seed Integer to be used as seed.

View File

@@ -27,18 +27,11 @@ use pocketmine\thread\Thread;
use function time;
class ServerKiller extends Thread{
/** @var int */
public $time;
private bool $stopped = false;
/**
* @param int $time
*/
public function __construct($time = 15){
$this->time = $time;
}
public function __construct(
public int $time = 15
){}
protected function onRun() : void{
$start = time();