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

@ -32,8 +32,7 @@ class Barrel extends Spawnable implements Container, Nameable{
use NameableTrait;
use ContainerTrait;
/** @var BarrelInventory */
protected $inventory;
protected BarrelInventory $inventory;
public function __construct(World $world, Vector3 $pos){
parent::__construct($world, $pos);

View File

@ -44,10 +44,8 @@ class Chest extends Spawnable implements Container, Nameable{
public const TAG_PAIRZ = "pairz";
public const TAG_PAIR_LEAD = "pairlead";
/** @var ChestInventory */
protected $inventory;
/** @var DoubleChestInventory|null */
protected $doubleInventory = null;
protected ChestInventory $inventory;
protected ?DoubleChestInventory $doubleInventory = null;
private ?int $pairX = null;
private ?int $pairZ = null;

View File

@ -33,8 +33,7 @@ use pocketmine\nbt\tag\CompoundTag;
class Comparator extends Tile{
private const TAG_OUTPUT_SIGNAL = "OutputSignal"; //int
/** @var int */
protected $signalStrength = 0;
protected int $signalStrength = 0;
public function getSignalStrength() : int{
return $this->signalStrength;

View File

@ -48,8 +48,7 @@ abstract class Furnace extends Spawnable implements Container, Nameable{
public const TAG_COOK_TIME = "CookTime";
public const TAG_MAX_TIME = "MaxTime";
/** @var FurnaceInventory */
protected $inventory;
protected FurnaceInventory $inventory;
private int $remainingFuelTime = 0;
private int $cookTime = 0;
private int $maxFuelTime = 0;

View File

@ -38,11 +38,9 @@ class ShulkerBox extends Spawnable implements Container, Nameable{
public const TAG_FACING = "facing";
/** @var int */
protected $facing = Facing::NORTH;
protected int $facing = Facing::NORTH;
/** @var ShulkerBoxInventory */
protected $inventory;
protected ShulkerBoxInventory $inventory;
public function __construct(World $world, Vector3 $pos){
parent::__construct($world, $pos);

View File

@ -50,11 +50,8 @@ class Sign extends Spawnable{
return array_slice(array_pad(explode("\n", $blob), 4, ""), 0, 4);
}
/** @var SignText */
protected $text;
/** @var int|null */
protected $editorEntityRuntimeId = null;
protected SignText $text;
protected ?int $editorEntityRuntimeId = null;
public function __construct(World $world, Vector3 $pos){
$this->text = new SignText();

View File

@ -45,12 +45,9 @@ abstract class Tile{
public const TAG_Y = "y";
public const TAG_Z = "z";
/** @var Position */
protected $position;
/** @var bool */
public $closed = false;
/** @var TimingsHandler */
protected $timings;
protected Position $position;
public bool $closed = false;
protected TimingsHandler $timings;
public function __construct(World $world, Vector3 $pos){
$this->position = Position::fromObject($pos, $world);

View File

@ -26,8 +26,7 @@ namespace pocketmine\block\utils;
use pocketmine\math\Facing;
trait AnyFacingTrait{
/** @var int */
protected $facing = Facing::DOWN;
protected int $facing = Facing::DOWN;
public function getFacing() : int{ return $this->facing; }

View File

@ -27,8 +27,7 @@ use pocketmine\math\Axis;
use pocketmine\math\Facing;
trait HorizontalFacingTrait{
/** @var int */
protected $facing = Facing::NORTH;
protected int $facing = Facing::NORTH;
public function getFacing() : int{ return $this->facing; }

View File

@ -32,9 +32,7 @@ use pocketmine\player\Player;
use pocketmine\world\BlockTransaction;
trait PillarRotationTrait{
/** @var int */
protected $axis = Axis::Y;
protected int $axis = Axis::Y;
/** @see Axis */
public function getAxis() : int{ return $this->axis; }