Drop a bunch of invalid null defaults

phpstan doesn't report these out of the box, for reasons I'm not clear on. It's also not clear if having null defaults has any effect on nullability behaviour, so they are best removed. In addition, these would be problematic on 7.4.
This commit is contained in:
Dylan K. Taylor 2020-02-05 20:53:54 +00:00
parent 41b1fa7b48
commit 495bfda044
7 changed files with 23 additions and 23 deletions

View File

@ -286,7 +286,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
/** @var PlayerCursorInventory */ /** @var PlayerCursorInventory */
protected $cursorInventory; protected $cursorInventory;
/** @var CraftingGrid */ /** @var CraftingGrid */
protected $craftingGrid = null; protected $craftingGrid;
/** @var CraftingTransaction|null */ /** @var CraftingTransaction|null */
protected $craftingTransaction = null; protected $craftingTransaction = null;
@ -348,7 +348,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
protected $flying = false; protected $flying = false;
/** @var PermissibleBase */ /** @var PermissibleBase */
private $perm = null; private $perm;
/** @var int|null */ /** @var int|null */
protected $lineHeight = null; protected $lineHeight = null;

View File

@ -193,16 +193,16 @@ class Server{
private $tickSleeper; private $tickSleeper;
/** @var BanList */ /** @var BanList */
private $banByName = null; private $banByName;
/** @var BanList */ /** @var BanList */
private $banByIP = null; private $banByIP;
/** @var Config */ /** @var Config */
private $operators = null; private $operators;
/** @var Config */ /** @var Config */
private $whitelist = null; private $whitelist;
/** @var bool */ /** @var bool */
private $isRunning = true; private $isRunning = true;
@ -211,13 +211,13 @@ class Server{
private $hasStopped = false; private $hasStopped = false;
/** @var PluginManager */ /** @var PluginManager */
private $pluginManager = null; private $pluginManager;
/** @var float */ /** @var float */
private $profilingTickRate = 20; private $profilingTickRate = 20;
/** @var AutoUpdater */ /** @var AutoUpdater */
private $updater = null; private $updater;
/** @var AsyncPool */ /** @var AsyncPool */
private $asyncPool; private $asyncPool;
@ -255,10 +255,10 @@ class Server{
private $memoryManager; private $memoryManager;
/** @var CommandReader */ /** @var CommandReader */
private $console = null; private $console;
/** @var SimpleCommandMap */ /** @var SimpleCommandMap */
private $commandMap = null; private $commandMap;
/** @var CraftingManager */ /** @var CraftingManager */
private $craftingManager; private $craftingManager;
@ -324,7 +324,7 @@ class Server{
private $queryHandler = null; private $queryHandler = null;
/** @var QueryRegenerateEvent */ /** @var QueryRegenerateEvent */
private $queryRegenerateTask = null; private $queryRegenerateTask;
/** @var Config */ /** @var Config */
private $properties; private $properties;

View File

@ -33,22 +33,22 @@ use function min;
*/ */
class BlockFactory{ class BlockFactory{
/** @var \SplFixedArray<Block> */ /** @var \SplFixedArray<Block> */
private static $fullList = null; private static $fullList;
/** @var \SplFixedArray<bool> */ /** @var \SplFixedArray<bool> */
public static $solid = null; public static $solid;
/** @var \SplFixedArray<bool> */ /** @var \SplFixedArray<bool> */
public static $transparent = null; public static $transparent;
/** @var \SplFixedArray<float> */ /** @var \SplFixedArray<float> */
public static $hardness = null; public static $hardness;
/** @var \SplFixedArray<int> */ /** @var \SplFixedArray<int> */
public static $light = null; public static $light;
/** @var \SplFixedArray<int> */ /** @var \SplFixedArray<int> */
public static $lightFilter = null; public static $lightFilter;
/** @var \SplFixedArray<bool> */ /** @var \SplFixedArray<bool> */
public static $diffusesSkyLight = null; public static $diffusesSkyLight;
/** @var \SplFixedArray<float> */ /** @var \SplFixedArray<float> */
public static $blastResistance = null; public static $blastResistance;
/** /**
* Initializes the block factory. By default this is called only once on server start, however you may wish to use * Initializes the block factory. By default this is called only once on server start, however you may wish to use

View File

@ -47,7 +47,7 @@ class ItemFactory{
* @var \SplFixedArray * @var \SplFixedArray
* @phpstan-var \SplFixedArray<Item> * @phpstan-var \SplFixedArray<Item>
*/ */
private static $list = null; private static $list;
/** /**
* @return void * @return void

View File

@ -265,7 +265,7 @@ class Level implements ChunkManager, Metadatable{
/** @var bool */ /** @var bool */
private $clearChunksOnTick; private $clearChunksOnTick;
/** @var \SplFixedArray<Block> */ /** @var \SplFixedArray<Block> */
private $randomTickBlocks = null; private $randomTickBlocks;
/** @var LevelTimings */ /** @var LevelTimings */
public $timings; public $timings;

View File

@ -28,7 +28,7 @@ use pocketmine\utils\BinaryDataException;
class PacketPool{ class PacketPool{
/** @var \SplFixedArray<DataPacket> */ /** @var \SplFixedArray<DataPacket> */
protected static $pool = null; protected static $pool;
/** /**
* @return void * @return void

View File

@ -38,7 +38,7 @@ class BanEntry{
/** @var string */ /** @var string */
private $name; private $name;
/** @var \DateTime */ /** @var \DateTime */
private $creationDate = null; private $creationDate;
/** @var string */ /** @var string */
private $source = "(Unknown)"; private $source = "(Unknown)";
/** @var \DateTime|null */ /** @var \DateTime|null */