mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Modernize private property declarations in Threaded classes
I previously avoided this due to being unsure of the effects; however, it's clear that we already use typed properties on Threaded things in other places anyway, and the only known issues are with uninit properties, and arrays.
This commit is contained in:
@ -29,14 +29,11 @@ class CompressBatchTask extends AsyncTask{
|
||||
|
||||
private const TLS_KEY_PROMISE = "promise";
|
||||
|
||||
/** @var string */
|
||||
private $data;
|
||||
/** @var Compressor */
|
||||
private $compressor;
|
||||
|
||||
public function __construct(string $data, CompressBatchPromise $promise, Compressor $compressor){
|
||||
$this->data = $data;
|
||||
$this->compressor = $compressor;
|
||||
public function __construct(
|
||||
private string $data,
|
||||
CompressBatchPromise $promise,
|
||||
private Compressor $compressor
|
||||
){
|
||||
$this->storeLocal(self::TLS_KEY_PROMISE, $promise);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user