mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 07:39:42 +00:00
phpdoc armageddon for master, pass 1
This commit is contained in:
@@ -44,9 +44,6 @@ class Language{
|
||||
public const FALLBACK_LANGUAGE = "eng";
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
*
|
||||
* @return array
|
||||
* @throws LanguageNotFoundException
|
||||
*/
|
||||
public static function getLanguageList(string $path = "") : array{
|
||||
@@ -88,10 +85,6 @@ class Language{
|
||||
protected $fallbackLang = [];
|
||||
|
||||
/**
|
||||
* @param string $lang
|
||||
* @param string|null $path
|
||||
* @param string $fallback
|
||||
*
|
||||
* @throws LanguageNotFoundException
|
||||
*/
|
||||
public function __construct(string $lang, ?string $path = null, string $fallback = self::FALLBACK_LANGUAGE){
|
||||
@@ -123,11 +116,7 @@ class Language{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $str
|
||||
* @param (float|int|string)[] $params
|
||||
* @param string|null $onlyPrefix
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function translateString(string $str, array $params = [], ?string $onlyPrefix = null) : string{
|
||||
$baseText = $this->get($str);
|
||||
@@ -155,30 +144,14 @@ class Language{
|
||||
return $baseText;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
protected function internalGet(string $id) : ?string{
|
||||
return $this->lang[$id] ?? $this->fallbackLang[$id] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get(string $id) : string{
|
||||
return $this->internalGet($id) ?? $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $text
|
||||
* @param string|null $onlyPrefix
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function parseTranslation(string $text, ?string $onlyPrefix = null) : string{
|
||||
$newString = "";
|
||||
|
||||
|
@@ -28,30 +28,18 @@ class TextContainer{
|
||||
/** @var string $text */
|
||||
protected $text;
|
||||
|
||||
/**
|
||||
* @param string $text
|
||||
*/
|
||||
public function __construct(string $text){
|
||||
$this->text = $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $text
|
||||
*/
|
||||
public function setText(string $text) : void{
|
||||
$this->text = $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getText() : string{
|
||||
return $this->text;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString() : string{
|
||||
return $this->getText();
|
||||
}
|
||||
|
@@ -29,7 +29,6 @@ class TranslationContainer extends TextContainer{
|
||||
protected $params = [];
|
||||
|
||||
/**
|
||||
* @param string $text
|
||||
* @param (float|int|string)[] $params
|
||||
*/
|
||||
public function __construct(string $text, array $params = []){
|
||||
@@ -50,11 +49,6 @@ class TranslationContainer extends TextContainer{
|
||||
return $this->params;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $i
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getParameter(int $i) : ?string{
|
||||
return $this->params[$i] ?? null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user