forked from fa/breadcrumb-the-shire
Rename the top-level lib/ directory to core/ so the project root immediately communicates which code is core platform and which lives in modules/. PHP namespaces (MintyPHP\*) are unchanged — only the Composer PSR-4 path mapping moves from lib/ to core/. Module-internal lib/ directories (modules/*/lib/) are untouched. Updated across the full stack: - composer.json PSR-4 mapping - bootstrap entry points (web/index.php, bin/*, tests/bootstrap.php) - tooling configs (phpstan.neon, phpunit.xml, php-cs-fixer) - 26 architecture contract tests - enforcement-policy, guard-catalog, quality-gates - all documentation (CLAUDE.md, README, 25 docs/, .agents/skills/) - bin/qa-extended.sh search paths - .claude/settings.local.json permission paths Workflow: .agents/runs/CORE-LIB-RENAME-001/ (Analyst → Planner → Executor → Code Review (4 findings fixed) → Security Review → Acceptance Test → Finalizer) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
136 lines
5.2 KiB
PHP
136 lines
5.2 KiB
PHP
<?php
|
|
|
|
namespace MintyPHP\Service\Settings;
|
|
|
|
use MintyPHP\Repository\Access\RoleRepositoryInterface;
|
|
use MintyPHP\Repository\Org\DepartmentRepositoryInterface;
|
|
use MintyPHP\Repository\Settings\SettingRepositoryInterface;
|
|
use MintyPHP\Repository\Tenant\TenantRepositoryInterface;
|
|
|
|
class SettingServicesFactory
|
|
{
|
|
private ?ThemeConfigGateway $themeConfigService = null;
|
|
private ?SettingCacheService $settingCacheService = null;
|
|
private ?SettingsCryptoGatewayInterface $settingsCryptoGateway = null;
|
|
private ?SettingsMetadataGateway $settingsMetadataGateway = null;
|
|
private ?SettingsDefaultsGateway $settingsDefaultsGateway = null;
|
|
private ?SettingsAppGateway $settingsAppGateway = null;
|
|
private ?SettingsApiPolicyGateway $settingsApiPolicyGateway = null;
|
|
private ?SettingsUserLifecycleGateway $settingsUserLifecycleGateway = null;
|
|
private ?SettingsSystemAuditGateway $settingsSystemAuditGateway = null;
|
|
private ?SettingsFrontendTelemetryGateway $settingsFrontendTelemetryGateway = null;
|
|
private ?SettingsMicrosoftGateway $settingsMicrosoftGateway = null;
|
|
private ?SettingsSessionGateway $settingsSessionGateway = null;
|
|
private ?SettingsSmtpGateway $settingsSmtpGateway = null;
|
|
private ?SettingsLoginPersistenceGateway $settingsLoginPersistenceGateway = null;
|
|
|
|
public function __construct(
|
|
private readonly SettingRepositoryFactory $settingRepositoryFactory
|
|
) {
|
|
}
|
|
|
|
public function createSettingRepository(): SettingRepositoryInterface
|
|
{
|
|
return $this->settingRepositoryFactory->createSettingRepository();
|
|
}
|
|
|
|
public function createSettingsMetadataGateway(): SettingsMetadataGateway
|
|
{
|
|
return $this->settingsMetadataGateway ??= new SettingsMetadataGateway($this->createSettingRepository());
|
|
}
|
|
|
|
public function createSettingsDefaultsGateway(): SettingsDefaultsGateway
|
|
{
|
|
return $this->settingsDefaultsGateway ??= new SettingsDefaultsGateway(
|
|
$this->createSettingsMetadataGateway(),
|
|
$this->createTenantRepository(),
|
|
$this->createRoleRepository(),
|
|
$this->createDepartmentRepository(),
|
|
);
|
|
}
|
|
|
|
public function createSettingsAppGateway(): SettingsAppGateway
|
|
{
|
|
return $this->settingsAppGateway ??= new SettingsAppGateway(
|
|
$this->createSettingsMetadataGateway(),
|
|
$this->createThemeConfigGateway(),
|
|
);
|
|
}
|
|
|
|
public function createSettingsApiPolicyGateway(): SettingsApiPolicyGateway
|
|
{
|
|
return $this->settingsApiPolicyGateway ??= new SettingsApiPolicyGateway($this->createSettingsMetadataGateway());
|
|
}
|
|
|
|
public function createSettingsUserLifecycleGateway(): SettingsUserLifecycleGateway
|
|
{
|
|
return $this->settingsUserLifecycleGateway ??= new SettingsUserLifecycleGateway($this->createSettingsMetadataGateway());
|
|
}
|
|
|
|
public function createSettingsSystemAuditGateway(): SettingsSystemAuditGateway
|
|
{
|
|
return $this->settingsSystemAuditGateway ??= new SettingsSystemAuditGateway($this->createSettingsMetadataGateway());
|
|
}
|
|
|
|
public function createSettingsFrontendTelemetryGateway(): SettingsFrontendTelemetryGateway
|
|
{
|
|
return $this->settingsFrontendTelemetryGateway ??= new SettingsFrontendTelemetryGateway($this->createSettingsMetadataGateway());
|
|
}
|
|
|
|
public function createSettingsMicrosoftGateway(): SettingsMicrosoftGateway
|
|
{
|
|
return $this->settingsMicrosoftGateway ??= new SettingsMicrosoftGateway(
|
|
$this->createSettingsMetadataGateway(),
|
|
$this->createSettingsCryptoGateway(),
|
|
);
|
|
}
|
|
|
|
public function createSettingsSessionGateway(): SettingsSessionGateway
|
|
{
|
|
return $this->settingsSessionGateway ??= new SettingsSessionGateway($this->createSettingsMetadataGateway());
|
|
}
|
|
|
|
public function createSettingsSmtpGateway(): SettingsSmtpGateway
|
|
{
|
|
return $this->settingsSmtpGateway ??= new SettingsSmtpGateway($this->createSettingsMetadataGateway());
|
|
}
|
|
|
|
public function createSettingsLoginPersistenceGateway(): SettingsLoginPersistenceGateway
|
|
{
|
|
return $this->settingsLoginPersistenceGateway ??= new SettingsLoginPersistenceGateway($this->createSettingsMetadataGateway());
|
|
}
|
|
|
|
public function createSettingCacheService(): SettingCacheService
|
|
{
|
|
return $this->settingCacheService ??= new SettingCacheService(
|
|
null,
|
|
$this->createSettingsMetadataGateway()
|
|
);
|
|
}
|
|
|
|
public function createThemeConfigGateway(): ThemeConfigGateway
|
|
{
|
|
return $this->themeConfigService ??= new ThemeConfigGateway();
|
|
}
|
|
|
|
public function createSettingsCryptoGateway(): SettingsCryptoGatewayInterface
|
|
{
|
|
return $this->settingsCryptoGateway ??= new SettingsCryptoGateway();
|
|
}
|
|
|
|
private function createTenantRepository(): TenantRepositoryInterface
|
|
{
|
|
return $this->settingRepositoryFactory->createTenantRepository();
|
|
}
|
|
|
|
private function createRoleRepository(): RoleRepositoryInterface
|
|
{
|
|
return $this->settingRepositoryFactory->createRoleRepository();
|
|
}
|
|
|
|
private function createDepartmentRepository(): DepartmentRepositoryInterface
|
|
{
|
|
return $this->settingRepositoryFactory->createDepartmentRepository();
|
|
}
|
|
}
|