Refactor helper drift in lib: centralize theme/translation and remove app() hotspots
This commit is contained in:
@@ -2,11 +2,15 @@
|
||||
|
||||
namespace MintyPHP\Service\Directory;
|
||||
|
||||
use MintyPHP\Service\Settings\SettingsAppGateway;
|
||||
use MintyPHP\Service\Settings\SettingsDefaultsGateway;
|
||||
|
||||
class DirectorySettingsGateway
|
||||
{
|
||||
public function __construct(private readonly SettingsDefaultsGateway $settingsDefaultsGateway)
|
||||
public function __construct(
|
||||
private readonly SettingsDefaultsGateway $settingsDefaultsGateway,
|
||||
private readonly SettingsAppGateway $settingsAppGateway
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -24,4 +28,9 @@ class DirectorySettingsGateway
|
||||
{
|
||||
$this->settingsDefaultsGateway->setDefaultRoleId($roleId);
|
||||
}
|
||||
|
||||
public function isAllowedTheme(string $theme): bool
|
||||
{
|
||||
return $this->settingsAppGateway->isAllowedTheme($theme);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user