mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Apply typehints to pocketmine\network\mcpe\protocol namespace
this is pulled from network-nuke in order to reduce the size of the diff.
This commit is contained in:
@ -103,7 +103,7 @@ class AvailableCommandsPacket extends DataPacket{
|
||||
*/
|
||||
public $commandData = [];
|
||||
|
||||
protected function decodePayload(){
|
||||
protected function decodePayload() : void{
|
||||
for($i = 0, $this->enumValuesCount = $this->getUnsignedVarInt(); $i < $this->enumValuesCount; ++$i){
|
||||
$this->enumValues[] = $this->getString();
|
||||
}
|
||||
@ -133,7 +133,7 @@ class AvailableCommandsPacket extends DataPacket{
|
||||
return $retval;
|
||||
}
|
||||
|
||||
protected function putEnum(CommandEnum $enum){
|
||||
protected function putEnum(CommandEnum $enum) : void{
|
||||
$this->putString($enum->enumName);
|
||||
|
||||
$this->putUnsignedVarInt(count($enum->enumValues));
|
||||
@ -157,7 +157,7 @@ class AvailableCommandsPacket extends DataPacket{
|
||||
}
|
||||
}
|
||||
|
||||
protected function putEnumValueIndex(int $index){
|
||||
protected function putEnumValueIndex(int $index) : void{
|
||||
if($this->enumValuesCount < 256){
|
||||
$this->putByte($index);
|
||||
}elseif($this->enumValuesCount < 65536){
|
||||
@ -201,7 +201,7 @@ class AvailableCommandsPacket extends DataPacket{
|
||||
return $retval;
|
||||
}
|
||||
|
||||
protected function putCommandData(CommandData $data){
|
||||
protected function putCommandData(CommandData $data) : void{
|
||||
$this->putString($data->commandName);
|
||||
$this->putString($data->commandDescription);
|
||||
$this->putByte($data->flags);
|
||||
@ -278,7 +278,7 @@ class AvailableCommandsPacket extends DataPacket{
|
||||
return "unknown ($argtype)";
|
||||
}
|
||||
|
||||
protected function encodePayload(){
|
||||
protected function encodePayload() : void{
|
||||
$enumValuesMap = [];
|
||||
$postfixesMap = [];
|
||||
$enumMap = [];
|
||||
|
Reference in New Issue
Block a user