Refactor helper drift in lib: centralize theme/translation and remove app() hotspots
This commit is contained in:
@@ -14,7 +14,8 @@ class UserLifecycleRestoreService
|
||||
private readonly UserReadRepositoryInterface $userReadRepository,
|
||||
private readonly UserWriteRepositoryInterface $userWriteRepository,
|
||||
private readonly UserLifecycleAuditService $userLifecycleAuditService,
|
||||
private readonly DatabaseSessionRepository $databaseSessionRepository
|
||||
private readonly DatabaseSessionRepository $databaseSessionRepository,
|
||||
private readonly UserSettingsGateway $userSettingsGateway
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -171,8 +172,7 @@ class UserLifecycleRestoreService
|
||||
|
||||
private function normalizeTheme(mixed $value): string
|
||||
{
|
||||
$theme = strtolower(trim((string) $value));
|
||||
$themes = appThemes();
|
||||
return isset($themes[$theme]) ? $theme : appDefaultTheme();
|
||||
$theme = is_scalar($value) ? (string) $value : null;
|
||||
return $this->userSettingsGateway->normalizeTheme($theme);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user