mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 17:59:41 +00:00
lang: populate missing return type information
This commit is contained in:
parent
205e47c0c4
commit
0db7e57a15
@ -105,6 +105,12 @@ class BaseLang{
|
|||||||
return $this->langName;
|
return $this->langName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $path
|
||||||
|
* @param string[] $d reference parameter
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
protected static function loadLang(string $path, array &$d){
|
protected static function loadLang(string $path, array &$d){
|
||||||
if(file_exists($path)){
|
if(file_exists($path)){
|
||||||
$d = array_map('\stripcslashes', parse_ini_file($path, false, INI_SCANNER_RAW));
|
$d = array_map('\stripcslashes', parse_ini_file($path, false, INI_SCANNER_RAW));
|
||||||
@ -132,6 +138,11 @@ class BaseLang{
|
|||||||
return $baseText;
|
return $baseText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param TextContainer $c
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function translate(TextContainer $c){
|
public function translate(TextContainer $c){
|
||||||
if($c instanceof TranslationContainer){
|
if($c instanceof TranslationContainer){
|
||||||
$baseText = $this->internalGet($c->getText());
|
$baseText = $this->internalGet($c->getText());
|
||||||
|
@ -37,6 +37,8 @@ class TextContainer{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $text
|
* @param string $text
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setText(string $text){
|
public function setText(string $text){
|
||||||
$this->text = $text;
|
$this->text = $text;
|
||||||
|
@ -59,6 +59,8 @@ class TranslationContainer extends TextContainer{
|
|||||||
/**
|
/**
|
||||||
* @param int $i
|
* @param int $i
|
||||||
* @param string $str
|
* @param string $str
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setParameter(int $i, string $str){
|
public function setParameter(int $i, string $str){
|
||||||
if($i < 0 or $i > count($this->params)){ //Intended, allow to set the last
|
if($i < 0 or $i > count($this->params)){ //Intended, allow to set the last
|
||||||
@ -70,6 +72,8 @@ class TranslationContainer extends TextContainer{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string[] $params
|
* @param string[] $params
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setParameters(array $params){
|
public function setParameters(array $params){
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user