WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\Domain

Bootstrap::register_dependencies() protected WC 1.0

Register core dependencies with the container.

{} It's a method of the class: Bootstrap{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->register_dependencies();

Code of Bootstrap::register_dependencies() WC 5.7.0

protected function register_dependencies() {
	$this->container->register(
		FeatureGating::class,
		function ( Container $container ) {
			return new FeatureGating();
		}
	);
	$this->container->register(
		AssetApi::class,
		function ( Container $container ) {
			return new AssetApi( $container->get( Package::class ) );
		}
	);
	$this->container->register(
		AssetDataRegistry::class,
		function( Container $container ) {
			return new AssetDataRegistry( $container->get( AssetApi::class ) );
		}
	);
	$this->container->register(
		AssetsController::class,
		function( Container $container ) {
			return new AssetsController( $container->get( AssetApi::class ) );
		}
	);
	$this->container->register(
		PaymentMethodRegistry::class,
		function( Container $container ) {
			return new PaymentMethodRegistry();
		}
	);
	$this->container->register(
		RestApi::class,
		function ( Container $container ) {
			return new RestApi( $container->get( RoutesController::class ) );
		}
	);
	$this->container->register(
		Installer::class,
		function ( Container $container ) {
			return new Installer();
		}
	);
	$this->container->register(
		BlockTypesController::class,
		function ( Container $container ) {
			$asset_api           = $container->get( AssetApi::class );
			$asset_data_registry = $container->get( AssetDataRegistry::class );
			return new BlockTypesController( $asset_api, $asset_data_registry );
		}
	);
	$this->container->register(
		DraftOrders::class,
		function( Container $container ) {
			return new DraftOrders( $container->get( Package::class ) );
		}
	);
	$this->container->register(
		CreateAccount::class,
		function( Container $container ) {
			return new CreateAccount( $container->get( Package::class ) );
		}
	);
	$this->container->register(
		Formatters::class,
		function( Container $container ) {
			$formatters = new Formatters();
			$formatters->register( 'money', MoneyFormatter::class );
			$formatters->register( 'html', HtmlFormatter::class );
			$formatters->register( 'currency', CurrencyFormatter::class );
			return $formatters;
		}
	);
	$this->container->register(
		SchemaController::class,
		function( Container $container ) {
			return new SchemaController( $container->get( ExtendRestApi::class ) );
		}
	);
	$this->container->register(
		RoutesController::class,
		function( Container $container ) {
			return new RoutesController( $container->get( SchemaController::class ) );
		}
	);
	$this->container->register(
		ExtendRestApi::class,
		function( Container $container ) {
			return new ExtendRestApi( $container->get( Package::class ), $container->get( Formatters::class ) );
		}
	);
	$this->container->register(
		GoogleAnalytics::class,
		function( Container $container ) {
			// Require Google Analytics Integration to be activated.
			if ( ! class_exists( 'WC_Google_Analytics_Integration' ) ) {
				return;
			}
			$asset_api = $container->get( AssetApi::class );
			return new GoogleAnalytics( $asset_api );
		}
	);
	if ( $this->package->feature()->is_feature_plugin_build() ) {
		$this->container->register(
			PaymentsApi::class,
			function ( Container $container ) {
				$payment_method_registry = $container->get( PaymentMethodRegistry::class );
				$asset_data_registry     = $container->get( AssetDataRegistry::class );
				return new PaymentsApi( $payment_method_registry, $asset_data_registry );
			}
		);
	}
}