lang: populate missing return type information

This commit is contained in:
Dylan K. Taylor 2020-01-19 17:04:25 +00:00
parent 205e47c0c4
commit 0db7e57a15
3 changed files with 17 additions and 0 deletions

View File

@ -105,6 +105,12 @@ class BaseLang{
return $this->langName;
}
/**
* @param string $path
* @param string[] $d reference parameter
*
* @return bool
*/
protected static function loadLang(string $path, array &$d){
if(file_exists($path)){
$d = array_map('\stripcslashes', parse_ini_file($path, false, INI_SCANNER_RAW));
@ -132,6 +138,11 @@ class BaseLang{
return $baseText;
}
/**
* @param TextContainer $c
*
* @return string
*/
public function translate(TextContainer $c){
if($c instanceof TranslationContainer){
$baseText = $this->internalGet($c->getText());

View File

@ -37,6 +37,8 @@ class TextContainer{
/**
* @param string $text
*
* @return void
*/
public function setText(string $text){
$this->text = $text;

View File

@ -59,6 +59,8 @@ class TranslationContainer extends TextContainer{
/**
* @param int $i
* @param string $str
*
* @return void
*/
public function setParameter(int $i, string $str){
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
*
* @return void
*/
public function setParameters(array $params){
$i = 0;