set( 'blocks.integration', static fn( Container $c ): BlocksIntegration => new BlocksIntegration( $c->get( 'extra.service' ), $c->get( 'goals.service' ) ) ); $c->set( 'blocks.registrar', static fn(): BlockRegistrar => new BlockRegistrar() ); } /** * {@inheritDoc} * * @param Container $c Container. */ public function boot( Container $c ): void { add_action( 'init', static fn() => $c->get( 'blocks.registrar' )->register_blocks(), 10 ); add_action( 'woocommerce_blocks_checkout_block_registration', static function ( $registry ) use ( $c ): void { if ( is_object( $registry ) && method_exists( $registry, 'register' ) ) { $registry->register( $c->get( 'blocks.integration' ) ); } } ); } }