singleton( AddonLicenseRegistry::class, function () use ( $container ) { $registry = AddonLicenseRegistry::getInstance(); if ( $container->has( LoggerInterface::class ) ) { $registry->setLogger( $container->get( LoggerInterface::class ) ); } return $registry; } ); // Alias the interface to the same instance so addons can depend on // the abstraction. Using a factory avoids a circular reference and // resolves through the singleton binding above. $container->singleton( AddonLicenseRegistryInterface::class, function () use ( $container ) { return $container->get( AddonLicenseRegistry::class ); } ); } /** * {@inheritdoc} */ public function boot( Container $container ): void { // No runtime wiring is needed at boot: the registry is pure state // populated by license providers at their own boot time. } }