phpdoc: populate missing parameter typeinfo

This commit is contained in:
Dylan K. Taylor
2020-01-11 21:53:24 +00:00
parent c329ff7d4f
commit 17720041a3
20 changed files with 260 additions and 3 deletions

View File

@@ -61,6 +61,10 @@ class Network{
}
/**
* @param float $upload
* @param float $download
*/
public function addStatistics($upload, $download){
$this->upload += $upload;
$this->download += $download;

View File

@@ -217,6 +217,9 @@ class RakLibInterface implements ServerInstance, AdvancedSourceInterface{
);
}
/**
* @param bool $name
*/
public function setPortCheck($name){
$this->interface->sendOption("portChecking", (bool) $name);
}

View File

@@ -162,6 +162,13 @@ class CraftingDataPacket extends DataPacket{
$this->cleanRecipes = $this->getBool();
}
/**
* @param object $entry
* @param NetworkBinaryStream $stream
* @param int $pos
*
* @return int
*/
private static function writeEntry($entry, NetworkBinaryStream $stream, int $pos){
if($entry instanceof ShapelessRecipe){
return self::writeShapelessRecipe($entry, $stream, $pos);

View File

@@ -156,10 +156,17 @@ abstract class DataPacket extends NetworkBinaryStream{
return $data;
}
/**
* @param string $name
*/
public function __get($name){
throw new \Error("Undefined property: " . get_class($this) . "::\$" . $name);
}
/**
* @param string $name
* @param mixed $value
*/
public function __set($name, $value){
throw new \Error("Undefined property: " . get_class($this) . "::\$" . $name);
}

View File

@@ -95,6 +95,14 @@ class RCONInstance extends Thread{
$this->start(PTHREADS_INHERIT_NONE);
}
/**
* @param resource $client
* @param int $requestID
* @param int $packetType
* @param string $payload
*
* @return int|false
*/
private function writePacket($client, int $requestID, int $packetType, string $payload){
$pk = Binary::writeLInt($requestID)
. Binary::writeLInt($packetType)
@@ -103,6 +111,14 @@ class RCONInstance extends Thread{
return socket_write($client, Binary::writeLInt(strlen($pk)) . $pk);
}
/**
* @param resource $client
* @param int $requestID reference parameter
* @param int $packetType reference parameter
* @param string $payload reference parameter
*
* @return bool
*/
private function readPacket($client, ?int &$requestID, ?int &$packetType, ?string &$payload){
$d = @socket_read($client, 4);
@@ -251,6 +267,9 @@ class RCONInstance extends Thread{
}
}
/**
* @param resource $client
*/
private function disconnectClient($client) : void{
socket_getpeername($client, $ip, $port);
@socket_set_option($client, SOL_SOCKET, SO_LINGER, ["l_onoff" => 1, "l_linger" => 1]);