Refactor helper drift in lib: centralize theme/translation and remove app() hotspots
This commit is contained in:
@@ -724,12 +724,8 @@ class UserAccountService
|
||||
|
||||
private function normalizeTheme($value): string
|
||||
{
|
||||
$theme = strtolower(trim((string) $value));
|
||||
$themes = function_exists('appThemes') ? appThemes() : ['light' => 'Light', 'dark' => 'Dark'];
|
||||
if ($theme === '' || !isset($themes[$theme])) {
|
||||
return function_exists('appDefaultTheme') ? appDefaultTheme() : 'light';
|
||||
}
|
||||
return $theme;
|
||||
$theme = is_scalar($value) ? (string) $value : null;
|
||||
return $this->settingsGateway->normalizeTheme($theme);
|
||||
}
|
||||
|
||||
private function normalizeLocale($value): string
|
||||
|
||||
Reference in New Issue
Block a user