1
0
mirror of https://github.com/xPaw/PHP-Source-Query.git synced 2026-06-11 00:23:15 +02:00

Docblocks, first pass with Psalm.

This commit is contained in:
Anthony Birkett
2021-05-30 10:47:59 +01:00
parent e62d011689
commit b5d355514b
11 changed files with 424 additions and 70 deletions
+21 -1
View File
@@ -22,7 +22,7 @@ use xPaw\SourceQuery\Exception\InvalidPacketException;
*
* @package xPaw\SourceQuery
*
* @uses xPaw\SourceQuery\Exception\InvalidPacketException
* @uses InvalidPacketException
*/
final class Buffer
{
@@ -43,6 +43,8 @@ final class Buffer
/**
* Sets buffer
*
* @param string $Buffer
*/
public function Set(string $Buffer): void
{
@@ -61,10 +63,20 @@ final class Buffer
return $this->Length - $this->Position;
}
/**
* @return bool
*/
public function isEmpty(): bool
{
return $this->Remaining() <= 0;
}
/**
* Gets data from buffer
*
* @param int $Length Bytes to read
*
* @return string
*/
public function Get(int $Length = -1): string
{
@@ -97,6 +109,8 @@ final class Buffer
/**
* Get short from buffer
*
* @throws InvalidPacketException
*/
public function GetShort(): int
{
@@ -111,6 +125,8 @@ final class Buffer
/**
* Get long from buffer
*
* @throws InvalidPacketException
*/
public function GetLong(): int
{
@@ -125,6 +141,8 @@ final class Buffer
/**
* Get float from buffer
*
* @throws InvalidPacketException
*/
public function GetFloat(): float
{
@@ -139,6 +157,8 @@ final class Buffer
/**
* Get unsigned long from buffer
*
* @throws InvalidPacketException
*/
public function GetUnsignedLong(): int
{