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>
102 lines
6.7 KiB
PHP
102 lines
6.7 KiB
PHP
<?php
|
|
|
|
namespace MintyPHP\App\Container\Registrars;
|
|
|
|
use MintyPHP\App\AppContainer;
|
|
use MintyPHP\App\Container\ContainerRegistrar;
|
|
use MintyPHP\App\Module\ModulePermissionSynchronizer;
|
|
use MintyPHP\App\Module\ModuleRegistry;
|
|
use MintyPHP\App\Module\ModuleRuntimeAssetPublisher;
|
|
use MintyPHP\App\Module\ModuleRuntimePageBuilder;
|
|
use MintyPHP\Http\CookieStore;
|
|
use MintyPHP\Http\CookieStoreInterface;
|
|
use MintyPHP\Http\Input\RequestInputFactory;
|
|
use MintyPHP\Http\IntendedUrlService;
|
|
use MintyPHP\Http\RequestRuntime;
|
|
use MintyPHP\Http\RequestRuntimeInterface;
|
|
use MintyPHP\Http\SessionStore;
|
|
use MintyPHP\Http\SessionStoreInterface;
|
|
use MintyPHP\Repository\Access\PermissionRepository;
|
|
use MintyPHP\Repository\Module\ModuleMigrationRepository;
|
|
use MintyPHP\Repository\Search\SearchQueryRepository;
|
|
use MintyPHP\Repository\Stats\AdminStatsRepository;
|
|
use MintyPHP\Repository\System\SystemHealthRepository;
|
|
use MintyPHP\Repository\Tenant\UserTenantRepository;
|
|
use MintyPHP\Service\Access\PermissionService;
|
|
use MintyPHP\Service\CustomField\CustomFieldServicesFactory;
|
|
use MintyPHP\Service\CustomField\TenantCustomFieldService;
|
|
use MintyPHP\Service\CustomField\UserCustomFieldValueService;
|
|
use MintyPHP\Service\Data\GridUserCountEnricher;
|
|
use MintyPHP\Service\Import\ImportService;
|
|
use MintyPHP\Service\Import\ImportServicesFactory;
|
|
use MintyPHP\Service\Mail\MailLogService;
|
|
use MintyPHP\Service\Mail\MailService;
|
|
use MintyPHP\Service\Mail\MailServicesFactory;
|
|
use MintyPHP\Service\Module\ModuleMigrationService;
|
|
use MintyPHP\Service\Scheduler\ScheduledJobService;
|
|
use MintyPHP\Service\Scheduler\SchedulerRunService;
|
|
use MintyPHP\Service\Scheduler\SchedulerServicesFactory;
|
|
use MintyPHP\Service\Search\SearchDataService;
|
|
use MintyPHP\Service\Security\RateLimiterService;
|
|
use MintyPHP\Service\Security\SecurityServicesFactory;
|
|
use MintyPHP\Service\Stats\AdminStatsViewDataService;
|
|
use MintyPHP\Service\System\SystemHealthService;
|
|
use MintyPHP\Service\System\SystemInfoService;
|
|
|
|
final class AppServicesRegistrar implements ContainerRegistrar
|
|
{
|
|
public function register(AppContainer $container): void
|
|
{
|
|
$projectRoot = dirname(__DIR__, 4);
|
|
|
|
$container->set(AdminStatsViewDataService::class, static fn (AppContainer $c): AdminStatsViewDataService => new AdminStatsViewDataService(
|
|
$c->get(AdminStatsRepository::class)
|
|
));
|
|
$container->set(SystemHealthRepository::class, static fn (): SystemHealthRepository => new SystemHealthRepository());
|
|
$container->set(SystemHealthService::class, static fn (AppContainer $c): SystemHealthService => new SystemHealthService(
|
|
$c->get(SystemHealthRepository::class)
|
|
));
|
|
$container->set(SystemInfoService::class, static fn (AppContainer $c): SystemInfoService => new SystemInfoService(
|
|
$c->get(SystemHealthService::class),
|
|
$c->get(SystemHealthRepository::class),
|
|
$c->has(ModuleRegistry::class) ? $c->get(ModuleRegistry::class) : null
|
|
));
|
|
$container->set(SearchDataService::class, static fn (AppContainer $c): SearchDataService => new SearchDataService(
|
|
$c->get(PermissionService::class),
|
|
$c->get(UserTenantRepository::class),
|
|
$c->get(SearchQueryRepository::class)
|
|
));
|
|
$container->set(RateLimiterService::class, static fn (AppContainer $c): RateLimiterService => $c->get(SecurityServicesFactory::class)->createRateLimiterService());
|
|
$container->set(MailService::class, static fn (AppContainer $c): MailService => $c->get(MailServicesFactory::class)->createMailService());
|
|
$container->set(MailLogService::class, static fn (AppContainer $c): MailLogService => $c->get(MailServicesFactory::class)->createMailLogService());
|
|
// Audit services are registered by the audit module's AuditContainerRegistrar.
|
|
$container->set(ImportService::class, static fn (AppContainer $c): ImportService => $c->get(ImportServicesFactory::class)->createImportService());
|
|
$container->set(ScheduledJobService::class, static fn (AppContainer $c): ScheduledJobService => $c->get(SchedulerServicesFactory::class)->createScheduledJobService());
|
|
$container->set(SchedulerRunService::class, static fn (AppContainer $c): SchedulerRunService => $c->get(SchedulerServicesFactory::class)->createSchedulerRunService());
|
|
$container->set(TenantCustomFieldService::class, static fn (AppContainer $c): TenantCustomFieldService => $c->get(CustomFieldServicesFactory::class)->createTenantCustomFieldService());
|
|
$container->set(UserCustomFieldValueService::class, static fn (AppContainer $c): UserCustomFieldValueService => $c->get(CustomFieldServicesFactory::class)->createUserCustomFieldValueService());
|
|
// AuditMetadataEnricher is registered by the audit module's AuditContainerRegistrar.
|
|
$container->set(GridUserCountEnricher::class, static fn (): GridUserCountEnricher => new GridUserCountEnricher());
|
|
$container->set(IntendedUrlService::class, static fn (): IntendedUrlService => new IntendedUrlService());
|
|
$container->set(RequestInputFactory::class, static fn (): RequestInputFactory => new RequestInputFactory());
|
|
$container->set(SessionStore::class, static fn (): SessionStore => new SessionStore());
|
|
$container->set(SessionStoreInterface::class, static fn (AppContainer $c): SessionStoreInterface => $c->get(SessionStore::class));
|
|
$container->set(CookieStore::class, static fn (): CookieStore => new CookieStore());
|
|
$container->set(CookieStoreInterface::class, static fn (AppContainer $c): CookieStoreInterface => $c->get(CookieStore::class));
|
|
$container->set(RequestRuntime::class, static fn (): RequestRuntime => new RequestRuntime());
|
|
$container->set(RequestRuntimeInterface::class, static fn (AppContainer $c): RequestRuntimeInterface => $c->get(RequestRuntime::class));
|
|
$container->set(ModuleMigrationRepository::class, static fn (): ModuleMigrationRepository => new ModuleMigrationRepository());
|
|
$container->set(ModuleMigrationService::class, static fn (AppContainer $c): ModuleMigrationService => new ModuleMigrationService(
|
|
$c->get(ModuleRegistry::class),
|
|
$c->get(ModuleMigrationRepository::class)
|
|
));
|
|
$container->set(ModulePermissionSynchronizer::class, fn (AppContainer $c): ModulePermissionSynchronizer => new ModulePermissionSynchronizer(
|
|
$c->get(ModuleRegistry::class),
|
|
$c->get(PermissionRepository::class),
|
|
$projectRoot . '/modules'
|
|
));
|
|
$container->set(ModuleRuntimePageBuilder::class, static fn (): ModuleRuntimePageBuilder => new ModuleRuntimePageBuilder());
|
|
$container->set(ModuleRuntimeAssetPublisher::class, static fn (): ModuleRuntimeAssetPublisher => new ModuleRuntimeAssetPublisher());
|
|
}
|
|
}
|