Added some missing typehints

This commit is contained in:
Dylan K. Taylor
2018-06-10 17:18:55 +01:00
parent 89643ff9af
commit c4c6c58615
19 changed files with 27 additions and 27 deletions

View File

@ -70,7 +70,7 @@ class QueryHandler{
$this->token = random_bytes(16);
}
public static function getTokenString($token, $salt){
public static function getTokenString(string $token, string $salt) : int{
return Binary::readInt(substr(hash("sha512", $salt . ":" . $token, true), 7, 4));
}

View File

@ -71,15 +71,15 @@ class RCONInstance extends Thread{
$this->start(PTHREADS_INHERIT_NONE);
}
private function writePacket($client, $requestID, $packetType, $payload){
$pk = Binary::writeLInt((int) $requestID)
. Binary::writeLInt((int) $packetType)
private function writePacket($client, int $requestID, int $packetType, string $payload){
$pk = Binary::writeLInt($requestID)
. Binary::writeLInt($packetType)
. $payload
. "\x00\x00"; //Terminate payload and packet
return socket_write($client, Binary::writeLInt(strlen($pk)) . $pk);
}
private function readPacket($client, &$requestID, &$packetType, &$payload){
private function readPacket($client, ?int &$requestID, ?int &$packetType, ?string &$payload){
$d = socket_read($client, 4);
if($this->stop){
return false;