mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
and more typehints
This commit is contained in:
@ -106,7 +106,7 @@ class BaseLang{
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function translateString($str, array $params = [], $onlyPrefix = null){
|
||||
public function translateString(string $str, array $params = [], string $onlyPrefix = null) : string{
|
||||
$baseText = $this->get($str);
|
||||
$baseText = $this->parseTranslation(($baseText !== null and ($onlyPrefix === null or strpos($str, $onlyPrefix) === 0)) ? $baseText : $str, $onlyPrefix);
|
||||
|
||||
@ -152,7 +152,13 @@ class BaseLang{
|
||||
return $id;
|
||||
}
|
||||
|
||||
protected function parseTranslation($text, $onlyPrefix = null){
|
||||
/**
|
||||
* @param string $text
|
||||
* @param string|null $onlyPrefix
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function parseTranslation(string $text, string $onlyPrefix = null) : string{
|
||||
$newString = "";
|
||||
|
||||
$replaceString = null;
|
||||
|
Reference in New Issue
Block a user