mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 00:39:45 +00:00
DataPacket: apply @return void annotations to make phpstan happy
this eliminates 250+ errors on level 6.
This commit is contained in:
parent
3400771770
commit
2d2c9379cd
@ -77,6 +77,7 @@ abstract class DataPacket extends NetworkBinaryStream{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws \OutOfBoundsException
|
||||
* @throws \UnexpectedValueException
|
||||
*/
|
||||
@ -87,6 +88,7 @@ abstract class DataPacket extends NetworkBinaryStream{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws \OutOfBoundsException
|
||||
* @throws \UnexpectedValueException
|
||||
*/
|
||||
@ -100,6 +102,7 @@ abstract class DataPacket extends NetworkBinaryStream{
|
||||
/**
|
||||
* Note for plugin developers: If you're adding your own packets, you should perform decoding in here.
|
||||
*
|
||||
* @return void
|
||||
* @throws \OutOfBoundsException
|
||||
* @throws \UnexpectedValueException
|
||||
*/
|
||||
@ -107,6 +110,9 @@ abstract class DataPacket extends NetworkBinaryStream{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->encodeHeader();
|
||||
@ -114,12 +120,17 @@ abstract class DataPacket extends NetworkBinaryStream{
|
||||
$this->isEncoded = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
protected function encodeHeader(){
|
||||
$this->putUnsignedVarInt(static::NETWORK_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Note for plugin developers: If you're adding your own packets, you should perform encoding in here.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function encodePayload(){
|
||||
|
||||
@ -137,6 +148,9 @@ abstract class DataPacket extends NetworkBinaryStream{
|
||||
*/
|
||||
abstract public function handle(NetworkSession $session) : bool;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function clean(){
|
||||
$this->buffer = "";
|
||||
$this->isEncoded = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user