EntityLink: remove rogue default ctor parameters

This commit is contained in:
Dylan K. Taylor 2020-06-15 23:58:11 +01:00
parent 2712befa82
commit 130c55d9f1
3 changed files with 7 additions and 24 deletions

View File

@ -647,14 +647,12 @@ class NetworkBinaryStream extends BinaryStream{
}
protected function getEntityLink() : EntityLink{
$link = new EntityLink();
$link->fromEntityUniqueId = $this->getEntityUniqueId();
$link->toEntityUniqueId = $this->getEntityUniqueId();
$link->type = $this->getByte();
$link->immediate = $this->getBool();
return $link;
return new EntityLink(
$fromEntityUniqueId = $this->getEntityUniqueId(),
$toEntityUniqueId = $this->getEntityUniqueId(),
$type = $this->getByte(),
$immediate = $this->getBool()
);
}
protected function putEntityLink(EntityLink $link) : void{

View File

@ -38,7 +38,7 @@ class EntityLink{
/** @var bool */
public $immediate; //for dismounting on mount death
public function __construct(int $fromEntityUniqueId = null, int $toEntityUniqueId = null, int $type = null, bool $immediate = false){
public function __construct(int $fromEntityUniqueId, int $toEntityUniqueId, int $type, bool $immediate){
$this->fromEntityUniqueId = $fromEntityUniqueId;
$this->toEntityUniqueId = $toEntityUniqueId;
$this->type = $type;

View File

@ -1545,21 +1545,6 @@ parameters:
count: 1
path: ../../../src/pocketmine/network/mcpe/protocol/SetScoreboardIdentityPacket.php
-
message: "#^Property pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\EntityLink\\:\\:\\$fromEntityUniqueId \\(int\\) does not accept int\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/network/mcpe/protocol/types/EntityLink.php
-
message: "#^Property pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\EntityLink\\:\\:\\$toEntityUniqueId \\(int\\) does not accept int\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/network/mcpe/protocol/types/EntityLink.php
-
message: "#^Property pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\EntityLink\\:\\:\\$type \\(int\\) does not accept int\\|null\\.$#"
count: 1
path: ../../../src/pocketmine/network/mcpe/protocol/types/EntityLink.php
-
message: "#^Argument of an invalid type array\\<pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\>\\|null supplied for foreach, only iterables are supported\\.$#"
count: 1