DataPacket: fixed var_dump() buffer bin2hex not working

in BinaryUtils new versions, BinaryStream->buffer is private.
detected by phpstan level 4
This commit is contained in:
Dylan K. Taylor 2019-12-12 15:02:42 +00:00
parent 9a31cbf5ef
commit 6ace4733ce

View File

@ -107,7 +107,7 @@ abstract class DataPacket extends NetworkBinaryStream implements Packet{
public function __debugInfo(){
$data = [];
foreach((array) $this as $k => $v){
if($k === "buffer" and is_string($v)){
if($v === $this->getBuffer()){
$data[$k] = bin2hex($v);
}elseif(is_string($v) or (is_object($v) and method_exists($v, "__toString"))){
$data[$k] = Utils::printable((string) $v);