Modernize private static property declarations

This commit is contained in:
Dylan K. Taylor 2022-05-17 21:55:16 +01:00
parent 1d5430937f
commit c0b15de504
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
6 changed files with 7 additions and 11 deletions

View File

@ -80,8 +80,7 @@ abstract class Entity{
public const MOTION_THRESHOLD = 0.00001;
protected const STEP_CLIP_MULTIPLIER = 0.4;
/** @var int */
private static $entityCount = 1;
private static int $entityCount = 1;
/**
* Returns a new runtime entity ID for a new entity.

View File

@ -30,8 +30,8 @@ use function get_class;
abstract class Event{
private const MAX_EVENT_CALL_DEPTH = 50;
/** @var int */
private static $eventCallDepth = 1;
private static int $eventCallDepth = 1;
/** @var string|null */
protected $eventName = null;

View File

@ -39,7 +39,7 @@ use function strlen;
*/
class ChunkCache implements ChunkListener{
/** @var self[][] */
private static $instances = [];
private static array $instances = [];
/**
* Fetches the ChunkCache instance for the given world. This lazily creates cache systems as needed.

View File

@ -27,8 +27,7 @@ namespace pocketmine\network\mcpe\convert;
* Accessor for SkinAdapter
*/
class SkinAdapterSingleton{
/** @var SkinAdapter|null */
private static $skinAdapter = null;
private static ?SkinAdapter $skinAdapter = null;
public static function get() : SkinAdapter{
if(self::$skinAdapter === null){

View File

@ -27,8 +27,7 @@ use function count;
use function spl_object_id;
class PermissionManager{
/** @var PermissionManager|null */
private static $instance = null;
private static ?self $instance = null;
public static function getInstance() : PermissionManager{
if(self::$instance === null){

View File

@ -27,8 +27,7 @@ use function spl_object_id;
class ThreadManager extends \Volatile{
/** @var ThreadManager|null */
private static $instance = null;
private static ?self $instance = null;
public static function init() : void{
self::$instance = new ThreadManager();