More PHP 7.1 nullables

This commit is contained in:
Dylan K. Taylor
2019-02-22 12:55:34 +00:00
parent 73a565355b
commit c26544475e
28 changed files with 50 additions and 50 deletions

View File

@ -94,7 +94,7 @@ class Language{
*
* @throws LanguageNotFoundException
*/
public function __construct(string $lang, string $path = null, string $fallback = self::FALLBACK_LANGUAGE){
public function __construct(string $lang, ?string $path = null, string $fallback = self::FALLBACK_LANGUAGE){
$this->langName = strtolower($lang);
if($path === null){
@ -129,7 +129,7 @@ class Language{
*
* @return string
*/
public function translateString(string $str, array $params = [], string $onlyPrefix = null) : string{
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);
@ -179,7 +179,7 @@ class Language{
*
* @return string
*/
protected function parseTranslation(string $text, string $onlyPrefix = null) : string{
protected function parseTranslation(string $text, ?string $onlyPrefix = null) : string{
$newString = "";
$replaceString = null;