singleton( ReleaseRepository::class, static function (): ReleaseRepository { global $wpdb; return new ReleaseRepository( $wpdb ); } ); $container->singleton( ReleaseStateMachine::class, static fn (): ReleaseStateMachine => new ReleaseStateMachine() ); $container->singleton( ReleaseService::class, static fn ( Container $c ): ReleaseService => new ReleaseService( $c->get( ReleaseRepository::class ), $c->get( ReleaseStateMachine::class ), $c->get( ProductService::class ), $c->get( StorageManager::class ) ) ); $container->singleton( ChangelogRenderer::class, static fn (): ChangelogRenderer => new ChangelogRenderer() ); $container->singleton( PackageSigner::class, static fn ( Container $c ): PackageSigner => new PackageSigner( $c->get( Crypto::class ) ) ); $container->singleton( UpdateService::class, static fn ( Container $c ): UpdateService => new UpdateService( $c->get( ProductRepository::class ), $c->get( ReleaseRepository::class ), $c->get( LicenseValidationService::class ), $c->get( LicenseRepository::class ), $c->get( SiteUrlNormalizer::class ), $c->get( ChangelogRenderer::class ), $c->get( PackageSigner::class ) ) ); $container->singleton( CustomerDownloads::class, static fn ( Container $c ): CustomerDownloads => new CustomerDownloads( $c->get( OrderRepository::class ), $c->get( ProductRepository::class ), $c->get( LicenseService::class ), $c->get( ReleaseRepository::class ), $c->get( PackageSigner::class ) ) ); } /** * Does not register hooks. * * @since 1.0.0 * * @param Container $container The shared plugin container. * @return void */ public function boot( Container $container ): void { // This provider has no hooks. } }