Packet: specify void return type in phpdoc (native return type not possible yet)

This commit is contained in:
Dylan K. Taylor 2020-01-18 19:58:14 +00:00
parent 2b4ce3ea6d
commit c0a45083b6
2 changed files with 10 additions and 6 deletions

View File

@ -30,6 +30,15 @@ interface Packet{
public function setOffset(int $offset) : void;
/**
* TODO: this can't have a native return type yet because of incompatibility with BinaryUtils
* really this should be addressed by making packets not extend BinaryStream, but that's a task for another day.
*
* @param string $buffer
* @param int $offset
*
* @return void
*/
public function setBuffer(string $buffer = "", int $offset = 0);
public function getOffset() : int;

View File

@ -122,12 +122,7 @@ class NetworkBinaryStream extends BinaryStream{
return new SkinData($skinId, $skinResourcePatch, $skinData, $animations, $capeData, $geometryData, $animationData, $premium, $persona, $capeOnClassic, $capeId);
}
/**
* @param SkinData $skin
*
* @return void
*/
public function putSkin(SkinData $skin){
public function putSkin(SkinData $skin): void{
$this->putString($skin->getSkinId());
$this->putString($skin->getResourcePatch());
$this->putSkinImage($skin->getSkinImage());