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>
75 lines
5.5 KiB
PHP
75 lines
5.5 KiB
PHP
<?php
|
|
|
|
namespace MintyPHP\App\Container\Registrars;
|
|
|
|
use MintyPHP\App\AppContainer;
|
|
use MintyPHP\App\Container\ContainerRegistrar;
|
|
use MintyPHP\Repository\Auth\ApiTokenRepository;
|
|
use MintyPHP\Repository\Auth\RememberTokenRepository;
|
|
use MintyPHP\Service\Access\RoleService;
|
|
use MintyPHP\Service\Audit\AuditRecorderInterface;
|
|
use MintyPHP\Service\Branding\BrandingFaviconService;
|
|
use MintyPHP\Service\Branding\BrandingLogoService;
|
|
use MintyPHP\Service\Branding\BrandingServicesFactory;
|
|
use MintyPHP\Service\Org\DepartmentService;
|
|
use MintyPHP\Service\Settings\AdminSettingsService;
|
|
use MintyPHP\Service\Settings\SettingCacheService;
|
|
use MintyPHP\Service\Settings\SettingsApiPolicyGateway;
|
|
use MintyPHP\Service\Settings\SettingsAppGateway;
|
|
use MintyPHP\Service\Settings\SettingsDefaultsGateway;
|
|
use MintyPHP\Service\Settings\SettingServicesFactory;
|
|
use MintyPHP\Service\Settings\SettingsFrontendTelemetryGateway;
|
|
use MintyPHP\Service\Settings\SettingsLoginPersistenceGateway;
|
|
use MintyPHP\Service\Settings\SettingsMetadataGateway;
|
|
use MintyPHP\Service\Settings\SettingsMicrosoftGateway;
|
|
use MintyPHP\Service\Settings\SettingsSessionGateway;
|
|
use MintyPHP\Service\Settings\SettingsSmtpGateway;
|
|
use MintyPHP\Service\Settings\SettingsSystemAuditGateway;
|
|
use MintyPHP\Service\Settings\SettingsUserLifecycleGateway;
|
|
use MintyPHP\Service\Settings\ThemeConfigGateway;
|
|
use MintyPHP\Service\Tenant\TenantService;
|
|
|
|
final class SettingsRegistrar implements ContainerRegistrar
|
|
{
|
|
public function register(AppContainer $container): void
|
|
{
|
|
$container->set(SettingsMetadataGateway::class, static fn (AppContainer $c): SettingsMetadataGateway => $c->get(SettingServicesFactory::class)->createSettingsMetadataGateway());
|
|
$container->set(SettingsDefaultsGateway::class, static fn (AppContainer $c): SettingsDefaultsGateway => $c->get(SettingServicesFactory::class)->createSettingsDefaultsGateway());
|
|
$container->set(SettingsAppGateway::class, static fn (AppContainer $c): SettingsAppGateway => $c->get(SettingServicesFactory::class)->createSettingsAppGateway());
|
|
$container->set(SettingsApiPolicyGateway::class, static fn (AppContainer $c): SettingsApiPolicyGateway => $c->get(SettingServicesFactory::class)->createSettingsApiPolicyGateway());
|
|
$container->set(SettingsUserLifecycleGateway::class, static fn (AppContainer $c): SettingsUserLifecycleGateway => $c->get(SettingServicesFactory::class)->createSettingsUserLifecycleGateway());
|
|
$container->set(SettingsSessionGateway::class, static fn (AppContainer $c): SettingsSessionGateway => $c->get(SettingServicesFactory::class)->createSettingsSessionGateway());
|
|
$container->set(SettingsSystemAuditGateway::class, static fn (AppContainer $c): SettingsSystemAuditGateway => $c->get(SettingServicesFactory::class)->createSettingsSystemAuditGateway());
|
|
$container->set(SettingsFrontendTelemetryGateway::class, static fn (AppContainer $c): SettingsFrontendTelemetryGateway => $c->get(SettingServicesFactory::class)->createSettingsFrontendTelemetryGateway());
|
|
$container->set(SettingsMicrosoftGateway::class, static fn (AppContainer $c): SettingsMicrosoftGateway => $c->get(SettingServicesFactory::class)->createSettingsMicrosoftGateway());
|
|
$container->set(SettingsSmtpGateway::class, static fn (AppContainer $c): SettingsSmtpGateway => $c->get(SettingServicesFactory::class)->createSettingsSmtpGateway());
|
|
$container->set(SettingsLoginPersistenceGateway::class, static fn (AppContainer $c): SettingsLoginPersistenceGateway => $c->get(SettingServicesFactory::class)->createSettingsLoginPersistenceGateway());
|
|
$container->set(SettingCacheService::class, static fn (AppContainer $c): SettingCacheService => $c->get(SettingServicesFactory::class)->createSettingCacheService());
|
|
$container->set(AdminSettingsService::class, static fn (AppContainer $c): AdminSettingsService => new AdminSettingsService(
|
|
$c->get(SettingsDefaultsGateway::class),
|
|
$c->get(SettingsAppGateway::class),
|
|
$c->get(SettingsApiPolicyGateway::class),
|
|
$c->get(SettingsUserLifecycleGateway::class),
|
|
$c->get(SettingsSessionGateway::class),
|
|
$c->get(SettingsSystemAuditGateway::class),
|
|
$c->get(SettingsFrontendTelemetryGateway::class),
|
|
$c->get(SettingsMicrosoftGateway::class),
|
|
$c->get(SettingsSmtpGateway::class),
|
|
$c->get(SettingsLoginPersistenceGateway::class),
|
|
$c->get(SettingsMetadataGateway::class),
|
|
$c->get(SettingCacheService::class),
|
|
$c->get(TenantService::class),
|
|
$c->get(RoleService::class),
|
|
$c->get(DepartmentService::class),
|
|
$c->get(RememberTokenRepository::class),
|
|
$c->get(ApiTokenRepository::class),
|
|
$c->get(AuditRecorderInterface::class)
|
|
));
|
|
$container->set(ThemeConfigGateway::class, static fn (AppContainer $c): ThemeConfigGateway => $c->get(SettingServicesFactory::class)->createThemeConfigGateway());
|
|
// Branding services are registered here because they depend on settings gateways
|
|
// and are consumed alongside settings (e.g. in UserAccessPdfService and the admin UI).
|
|
$container->set(BrandingLogoService::class, static fn (AppContainer $c): BrandingLogoService => $c->get(BrandingServicesFactory::class)->createBrandingLogoService());
|
|
$container->set(BrandingFaviconService::class, static fn (AppContainer $c): BrandingFaviconService => $c->get(BrandingServicesFactory::class)->createBrandingFaviconService());
|
|
}
|
|
}
|