From cd2c9c5741151ba4f3d319dad03dc5446eefc37c Mon Sep 17 00:00:00 2001 From: fs Date: Sun, 26 Apr 2026 21:30:34 +0200 Subject: [PATCH] fix(user-lifecycle): bind UserSettingsGateway in container MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previous commit 06118c1 wired UserLifecyclePolicyDashboardService to $c->get(UserSettingsGateway::class) without ensuring the gateway itself was a container service. The gateway is built by UserServicesFactory::createUserSettingsGateway() and was previously only obtained transitively as a constructor argument of other factory-built services — never resolved through the container directly. Result at runtime: 500 with "Service not bound: MintyPHP\\Service\\User\\UserSettingsGateway" the first time the user-lifecycle settings page tried to construct the dashboard service. Adds the missing binding in UserRegistrar — same factory delegation the file uses for UserAccountService, UserAssignmentService, etc. Unit tests didn't catch this because they construct the dashboard service with mocked dependencies; only the live page touched the real container path. Co-Authored-By: Claude Opus 4.7 (1M context) --- core/App/Container/Registrars/UserRegistrar.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/App/Container/Registrars/UserRegistrar.php b/core/App/Container/Registrars/UserRegistrar.php index 74321d9..4956d3b 100644 --- a/core/App/Container/Registrars/UserRegistrar.php +++ b/core/App/Container/Registrars/UserRegistrar.php @@ -35,6 +35,7 @@ final class UserRegistrar implements ContainerRegistrar { public function register(AppContainer $container): void { + $container->set(UserSettingsGateway::class, static fn (AppContainer $c): UserSettingsGateway => $c->get(UserServicesFactory::class)->createUserSettingsGateway()); $container->set(UserAccountService::class, static fn (AppContainer $c): UserAccountService => $c->get(UserServicesFactory::class)->createUserAccountService()); $container->set(UserAssignmentService::class, static fn (AppContainer $c): UserAssignmentService => $c->get(UserServicesFactory::class)->createUserAssignmentService()); $container->set(UserPasswordService::class, static fn (AppContainer $c): UserPasswordService => $c->get(UserServicesFactory::class)->createUserPasswordService());