mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-08 04:00:14 -05:00
refactor: if / else / elseif statements
- Change If Else Value Assign To Early Return - Change Nested Ifs To Early Return - Remove Always Else
This commit is contained in:
@@ -52,12 +52,10 @@ class Language
|
||||
}
|
||||
|
||||
if (config('language.mode.code', 'short') == 'short') {
|
||||
$code = strtolower(substr(self::getLongCode($locale), 3));
|
||||
} else {
|
||||
$code = strtolower(substr($locale, 3));
|
||||
return strtolower(substr(self::getLongCode($locale), 3));
|
||||
}
|
||||
|
||||
return $code;
|
||||
return strtolower(substr($locale, 3));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,9 +84,8 @@ class Language
|
||||
|
||||
if (config('language.allowed')) {
|
||||
return self::names(array_merge(config('language.allowed'), [config('app.locale')]));
|
||||
} else {
|
||||
return self::names([config('app.locale')]);
|
||||
}
|
||||
return self::names([config('app.locale')]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user