mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 08:49:42 +00:00
utils: populate missing return type information
This commit is contained in:
parent
e419d76367
commit
0b9d0f3cdc
@ -57,6 +57,8 @@ class Color{
|
|||||||
* Sets the alpha (opacity) value of this colour, lower = more transparent
|
* Sets the alpha (opacity) value of this colour, lower = more transparent
|
||||||
*
|
*
|
||||||
* @param int $a
|
* @param int $a
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setA(int $a){
|
public function setA(int $a){
|
||||||
$this->a = $a & 0xff;
|
$this->a = $a & 0xff;
|
||||||
@ -74,6 +76,8 @@ class Color{
|
|||||||
* Sets the red value of this colour.
|
* Sets the red value of this colour.
|
||||||
*
|
*
|
||||||
* @param int $r
|
* @param int $r
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setR(int $r){
|
public function setR(int $r){
|
||||||
$this->r = $r & 0xff;
|
$this->r = $r & 0xff;
|
||||||
@ -91,6 +95,8 @@ class Color{
|
|||||||
* Sets the green value of this colour.
|
* Sets the green value of this colour.
|
||||||
*
|
*
|
||||||
* @param int $g
|
* @param int $g
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setG(int $g){
|
public function setG(int $g){
|
||||||
$this->g = $g & 0xff;
|
$this->g = $g & 0xff;
|
||||||
@ -108,6 +114,8 @@ class Color{
|
|||||||
* Sets the blue value of this colour.
|
* Sets the blue value of this colour.
|
||||||
*
|
*
|
||||||
* @param int $b
|
* @param int $b
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setB(int $b){
|
public function setB(int $b){
|
||||||
$this->b = $b & 0xff;
|
$this->b = $b & 0xff;
|
||||||
|
@ -118,6 +118,8 @@ class Config{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes all the changes in memory and loads the file again
|
* Removes all the changes in memory and loads the file again
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function reload(){
|
public function reload(){
|
||||||
$this->config = [];
|
$this->config = [];
|
||||||
@ -333,6 +335,8 @@ class Config{
|
|||||||
/**
|
/**
|
||||||
* @param string $k
|
* @param string $k
|
||||||
* @param mixed $v
|
* @param mixed $v
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __set($k, $v){
|
public function __set($k, $v){
|
||||||
$this->set($k, $v);
|
$this->set($k, $v);
|
||||||
@ -357,6 +361,8 @@ class Config{
|
|||||||
/**
|
/**
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param mixed $value
|
* @param mixed $value
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setNested($key, $value){
|
public function setNested($key, $value){
|
||||||
$vars = explode(".", $key);
|
$vars = explode(".", $key);
|
||||||
@ -446,6 +452,8 @@ class Config{
|
|||||||
/**
|
/**
|
||||||
* @param string $k key to be set
|
* @param string $k key to be set
|
||||||
* @param mixed $v value to set key
|
* @param mixed $v value to set key
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function set($k, $v = true){
|
public function set($k, $v = true){
|
||||||
$this->config[$k] = $v;
|
$this->config[$k] = $v;
|
||||||
@ -459,6 +467,8 @@ class Config{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $v
|
* @param array $v
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setAll(array $v){
|
public function setAll(array $v){
|
||||||
$this->config = $v;
|
$this->config = $v;
|
||||||
@ -483,6 +493,8 @@ class Config{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $k
|
* @param string $k
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function remove($k){
|
public function remove($k){
|
||||||
unset($this->config[$k]);
|
unset($this->config[$k]);
|
||||||
@ -500,6 +512,8 @@ class Config{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $defaults
|
* @param array $defaults
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setDefaults(array $defaults){
|
public function setDefaults(array $defaults){
|
||||||
$this->fillDefaults($defaults, $this->config);
|
$this->fillDefaults($defaults, $this->config);
|
||||||
|
@ -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
|
* 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}.
|
* want the logger to be accessible via {@link MainLogger#getLogger}.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function registerStatic(){
|
public function registerStatic(){
|
||||||
if(static::$logger === null){
|
if(static::$logger === null){
|
||||||
@ -191,6 +193,8 @@ class MainLogger extends \AttachableThreadedLogger{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param bool $logDebug
|
* @param bool $logDebug
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setLogDebug(bool $logDebug){
|
public function setLogDebug(bool $logDebug){
|
||||||
$this->logDebug = $logDebug;
|
$this->logDebug = $logDebug;
|
||||||
@ -199,6 +203,8 @@ class MainLogger extends \AttachableThreadedLogger{
|
|||||||
/**
|
/**
|
||||||
* @param \Throwable $e
|
* @param \Throwable $e
|
||||||
* @param array|null $trace
|
* @param array|null $trace
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function logException(\Throwable $e, $trace = null){
|
public function logException(\Throwable $e, $trace = null){
|
||||||
if($trace === null){
|
if($trace === null){
|
||||||
@ -281,6 +287,9 @@ class MainLogger extends \AttachableThreadedLogger{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function shutdown(){
|
public function shutdown(){
|
||||||
$this->shutdown = true;
|
$this->shutdown = true;
|
||||||
$this->notify();
|
$this->notify();
|
||||||
@ -291,6 +300,8 @@ class MainLogger extends \AttachableThreadedLogger{
|
|||||||
* @param string $level
|
* @param string $level
|
||||||
* @param string $prefix
|
* @param string $prefix
|
||||||
* @param string $color
|
* @param string $color
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function send($message, $level, $prefix, $color){
|
protected function send($message, $level, $prefix, $color){
|
||||||
/** @var \DateTime|null $time */
|
/** @var \DateTime|null $time */
|
||||||
@ -326,6 +337,9 @@ class MainLogger extends \AttachableThreadedLogger{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function syncFlushBuffer(){
|
public function syncFlushBuffer(){
|
||||||
$this->syncFlush = true;
|
$this->syncFlush = true;
|
||||||
$this->synchronized(function(){
|
$this->synchronized(function(){
|
||||||
@ -352,6 +366,9 @@ class MainLogger extends \AttachableThreadedLogger{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function run(){
|
public function run(){
|
||||||
$logResource = fopen($this->logFile, "ab");
|
$logResource = fopen($this->logFile, "ab");
|
||||||
if(!is_resource($logResource)){
|
if(!is_resource($logResource)){
|
||||||
|
@ -71,6 +71,8 @@ class Random{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $seed Integer to be used as seed.
|
* @param int $seed Integer to be used as seed.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setSeed(int $seed){
|
public function setSeed(int $seed){
|
||||||
$this->seed = $seed;
|
$this->seed = $seed;
|
||||||
|
@ -42,6 +42,9 @@ class ServerKiller extends Thread{
|
|||||||
$this->time = $time;
|
$this->time = $time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function run(){
|
public function run(){
|
||||||
$this->registerClassLoader();
|
$this->registerClassLoader();
|
||||||
$start = time();
|
$start = time();
|
||||||
|
@ -101,6 +101,9 @@ abstract class Terminal{
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
protected static function getFallbackEscapeCodes(){
|
protected static function getFallbackEscapeCodes(){
|
||||||
self::$FORMAT_BOLD = "\x1b[1m";
|
self::$FORMAT_BOLD = "\x1b[1m";
|
||||||
self::$FORMAT_OBFUSCATED = "";
|
self::$FORMAT_OBFUSCATED = "";
|
||||||
@ -128,6 +131,9 @@ abstract class Terminal{
|
|||||||
self::$COLOR_WHITE = "\x1b[38;5;231m";
|
self::$COLOR_WHITE = "\x1b[38;5;231m";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
protected static function getEscapeCodes(){
|
protected static function getEscapeCodes(){
|
||||||
self::$FORMAT_BOLD = `tput bold`;
|
self::$FORMAT_BOLD = `tput bold`;
|
||||||
self::$FORMAT_OBFUSCATED = `tput smacs`;
|
self::$FORMAT_OBFUSCATED = `tput smacs`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user