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

View File

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

View File

@ -33,22 +33,22 @@ use function min;
*/
class BlockFactory{
/** @var \SplFixedArray<Block> */
private static $fullList = null;
private static $fullList;
/** @var \SplFixedArray<bool> */
public static $solid = null;
public static $solid;
/** @var \SplFixedArray<bool> */
public static $transparent = null;
public static $transparent;
/** @var \SplFixedArray<float> */
public static $hardness = null;
public static $hardness;
/** @var \SplFixedArray<int> */
public static $light = null;
public static $light;
/** @var \SplFixedArray<int> */
public static $lightFilter = null;
public static $lightFilter;
/** @var \SplFixedArray<bool> */
public static $diffusesSkyLight = null;
public static $diffusesSkyLight;
/** @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

View File

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

View File

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

View File

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

View File

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