Apply typehints to more general pocketmine\network namespace

This commit is contained in:
Dylan K. Taylor
2018-07-05 13:36:23 +01:00
parent 950465d283
commit 2907de81ad
10 changed files with 46 additions and 46 deletions

View File

@ -58,14 +58,14 @@ class QueryHandler{
$this->server->getLogger()->info($this->server->getLanguage()->translateString("pocketmine.server.query.running", [$addr, $port]));
}
public function regenerateInfo(){
public function regenerateInfo() : void{
$ev = $this->server->getQueryInformation();
$this->longData = $ev->getLongQuery();
$this->shortData = $ev->getShortQuery();
$this->timeout = microtime(true) + $ev->getTimeout();
}
public function regenerateToken(){
public function regenerateToken() : void{
$this->lastToken = $this->token;
$this->token = random_bytes(16);
}
@ -74,7 +74,7 @@ class QueryHandler{
return Binary::readInt(substr(hash("sha512", $salt . ":" . $token, true), 7, 4));
}
public function handle(AdvancedSourceInterface $interface, string $address, int $port, string $packet){
public function handle(AdvancedSourceInterface $interface, string $address, int $port, string $packet) : void{
$offset = 2;
$packetType = ord($packet{$offset++});
$sessionID = Binary::readInt(substr($packet, $offset, 4));