More typehints, documentation fixes and static analysis cleanup

This commit is contained in:
Dylan K. Taylor
2017-07-15 12:12:06 +01:00
parent 24bdf330d5
commit dbb92096e4
66 changed files with 309 additions and 219 deletions

View File

@ -30,6 +30,7 @@ class RCONInstance extends Thread{
public $stop;
public $cmd;
public $response;
/** @var resource */
private $socket;
private $password;
private $maxClients;
@ -39,14 +40,18 @@ class RCONInstance extends Thread{
return $this->waiting === true;
}
public function __construct($socket, $password, $maxClients = 50){
/**
* @param resource $socket
* @param string $password
* @param int $maxClients
*/
public function __construct($socket, string $password, int $maxClients = 50){
$this->stop = false;
$this->cmd = "";
$this->response = "";
$this->socket = $socket;
$this->password = $password;
$this->maxClients = (int) $maxClients;
$this->maxClients = $maxClients;
for($n = 0; $n < $this->maxClients; ++$n){
$this->{"client" . $n} = null;
$this->{"status" . $n} = 0;
@ -192,7 +197,7 @@ class RCONInstance extends Thread{
exit(0);
}
public function getThreadName(){
public function getThreadName() : string{
return "RCON";
}
}