1
0
mirror of https://github.com/xPaw/PHP-Source-Query.git synced 2026-05-18 14:33:34 +02:00

Fix up some type information

This commit is contained in:
Pavel Djundik
2020-06-23 19:44:51 +03:00
parent 1078e47b7e
commit b87c9faab9
5 changed files with 23 additions and 10 deletions
+9 -2
View File
@@ -13,13 +13,15 @@
namespace xPaw\SourceQuery;
use xPaw\SourceQuery\Exception\InvalidPacketException;
use xPaw\SourceQuery\Exception\SocketException;
/**
* Base socket interface
*
* @package xPaw\SourceQuery
*
* @uses xPaw\SourceQuery\Exception\InvalidPacketException
* @uses xPaw\SourceQuery\Exception\SocketException
*/
abstract class BaseSocket
{
@@ -58,6 +60,7 @@
$Packets = [];
$IsCompressed = false;
$ReadMore = false;
$PacketChecksum = null;
do
{
@@ -92,6 +95,10 @@
break;
}
default:
{
throw new SocketException( 'Unknown engine.', SocketException::INVALID_ENGINE );
}
}
$Packets[ $PacketNumber ] = $Buffer->Get( );
@@ -113,7 +120,7 @@
$Data = bzdecompress( $Data );
if( CRC32( $Data ) !== $PacketChecksum )
if( !is_string( $Data ) || CRC32( $Data ) !== $PacketChecksum )
{
throw new InvalidPacketException( 'CRC32 checksum mismatch of uncompressed packet data.', InvalidPacketException::CHECKSUM_MISMATCH );
}