utils: populate missing return type information

This commit is contained in:
Dylan K. Taylor 2020-01-19 17:07:48 +00:00
parent e419d76367
commit 0b9d0f3cdc
6 changed files with 50 additions and 0 deletions

View File

@ -57,6 +57,8 @@ class Color{
* Sets the alpha (opacity) value of this colour, lower = more transparent
*
* @param int $a
*
* @return void
*/
public function setA(int $a){
$this->a = $a & 0xff;
@ -74,6 +76,8 @@ class Color{
* Sets the red value of this colour.
*
* @param int $r
*
* @return void
*/
public function setR(int $r){
$this->r = $r & 0xff;
@ -91,6 +95,8 @@ class Color{
* Sets the green value of this colour.
*
* @param int $g
*
* @return void
*/
public function setG(int $g){
$this->g = $g & 0xff;
@ -108,6 +114,8 @@ class Color{
* Sets the blue value of this colour.
*
* @param int $b
*
* @return void
*/
public function setB(int $b){
$this->b = $b & 0xff;

View File

@ -118,6 +118,8 @@ class Config{
/**
* Removes all the changes in memory and loads the file again
*
* @return void
*/
public function reload(){
$this->config = [];
@ -333,6 +335,8 @@ class Config{
/**
* @param string $k
* @param mixed $v
*
* @return void
*/
public function __set($k, $v){
$this->set($k, $v);
@ -357,6 +361,8 @@ class Config{
/**
* @param string $key
* @param mixed $value
*
* @return void
*/
public function setNested($key, $value){
$vars = explode(".", $key);
@ -446,6 +452,8 @@ class Config{
/**
* @param string $k key to be set
* @param mixed $v value to set key
*
* @return void
*/
public function set($k, $v = true){
$this->config[$k] = $v;
@ -459,6 +467,8 @@ class Config{
/**
* @param array $v
*
* @return void
*/
public function setAll(array $v){
$this->config = $v;
@ -483,6 +493,8 @@ class Config{
/**
* @param string $k
*
* @return void
*/
public function remove($k){
unset($this->config[$k]);
@ -500,6 +512,8 @@ class Config{
/**
* @param array $defaults
*
* @return void
*/
public function setDefaults(array $defaults){
$this->fillDefaults($defaults, $this->config);

View File

@ -121,6 +121,8 @@ class MainLogger extends \AttachableThreadedLogger{
*
* WARNING: Because static properties are thread-local, this MUST be called from the body of every Thread if you
* want the logger to be accessible via {@link MainLogger#getLogger}.
*
* @return void
*/
public function registerStatic(){
if(static::$logger === null){
@ -191,6 +193,8 @@ class MainLogger extends \AttachableThreadedLogger{
/**
* @param bool $logDebug
*
* @return void
*/
public function setLogDebug(bool $logDebug){
$this->logDebug = $logDebug;
@ -199,6 +203,8 @@ class MainLogger extends \AttachableThreadedLogger{
/**
* @param \Throwable $e
* @param array|null $trace
*
* @return void
*/
public function logException(\Throwable $e, $trace = null){
if($trace === null){
@ -281,6 +287,9 @@ class MainLogger extends \AttachableThreadedLogger{
}
}
/**
* @return void
*/
public function shutdown(){
$this->shutdown = true;
$this->notify();
@ -291,6 +300,8 @@ class MainLogger extends \AttachableThreadedLogger{
* @param string $level
* @param string $prefix
* @param string $color
*
* @return void
*/
protected function send($message, $level, $prefix, $color){
/** @var \DateTime|null $time */
@ -326,6 +337,9 @@ class MainLogger extends \AttachableThreadedLogger{
});
}
/**
* @return void
*/
public function syncFlushBuffer(){
$this->syncFlush = true;
$this->synchronized(function(){
@ -352,6 +366,9 @@ class MainLogger extends \AttachableThreadedLogger{
}
}
/**
* @return void
*/
public function run(){
$logResource = fopen($this->logFile, "ab");
if(!is_resource($logResource)){

View File

@ -71,6 +71,8 @@ class Random{
/**
* @param int $seed Integer to be used as seed.
*
* @return void
*/
public function setSeed(int $seed){
$this->seed = $seed;

View File

@ -42,6 +42,9 @@ class ServerKiller extends Thread{
$this->time = $time;
}
/**
* @return void
*/
public function run(){
$this->registerClassLoader();
$start = time();

View File

@ -101,6 +101,9 @@ abstract class Terminal{
return $result;
}
/**
* @return void
*/
protected static function getFallbackEscapeCodes(){
self::$FORMAT_BOLD = "\x1b[1m";
self::$FORMAT_OBFUSCATED = "";
@ -128,6 +131,9 @@ abstract class Terminal{
self::$COLOR_WHITE = "\x1b[38;5;231m";
}
/**
* @return void
*/
protected static function getEscapeCodes(){
self::$FORMAT_BOLD = `tput bold`;
self::$FORMAT_OBFUSCATED = `tput smacs`;