and more typehints

This commit is contained in:
Dylan K. Taylor
2017-07-14 10:56:51 +01:00
parent b9355387da
commit c3b8be3f60
119 changed files with 598 additions and 541 deletions

View File

@ -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;