Automattic\WooCommerce\Blocks\Domain

Bootstrap::register_dependencies()protectedWC 1.0

Register core dependencies with the container.

{} Это метод класса: Bootstrap{}

Хуков нет.

Возвращает

null. Ничего.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->register_dependencies();

Код Bootstrap::register_dependencies() WC 7.1.0

protected function register_dependencies() {
	$this->container->register(
		FeatureGating::class,
		function () {
			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() {
			return new PaymentMethodRegistry();
		}
	);
	$this->container->register(
		Installer::class,
		function () {
			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(
		BlockTemplatesController::class,
		function ( Container $container ) {
			return new BlockTemplatesController( $container->get( Package::class ) );
		}
	);
	$this->container->register(
		ProductSearchResultsTemplate::class,
		function () {
			return new ProductSearchResultsTemplate();
		}
	);
	$this->container->register(
		ProductAttributeTemplate::class,
		function () {
			return new ProductAttributeTemplate();
		}
	);
	$this->container->register(
		ClassicTemplatesCompatibility::class,
		function ( Container $container ) {
			$asset_data_registry = $container->get( AssetDataRegistry::class );
			return new ClassicTemplatesCompatibility( $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(
		GoogleAnalytics::class,
		function( Container $container ) {
			// Require Google Analytics Integration to be activated.
			if ( ! class_exists( 'WC_Google_Analytics_Integration', false ) ) {
				return;
			}
			$asset_api = $container->get( AssetApi::class );
			return new GoogleAnalytics( $asset_api );
		}
	);
	$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 );
		}
	);
	$this->container->register(
		StoreApi::class,
		function () {
			return new StoreApi();
		}
	);
	// Maintains backwards compatibility with previous Store API namespace.
	$this->container->register(
		'Automattic\WooCommerce\Blocks\StoreApi\Formatters',
		function( Container $container ) {
			$this->deprecated_dependency( 'Automattic\WooCommerce\Blocks\StoreApi\Formatters', '7.2.0', 'Automattic\WooCommerce\StoreApi\Formatters', '7.4.0' );
			return $container->get( StoreApi::class )::container()->get( \Automattic\WooCommerce\StoreApi\Formatters::class );
		}
	);
	$this->container->register(
		'Automattic\WooCommerce\Blocks\Domain\Services\ExtendRestApi',
		function( Container $container ) {
			$this->deprecated_dependency( 'Automattic\WooCommerce\Blocks\Domain\Services\ExtendRestApi', '7.2.0', 'Automattic\WooCommerce\StoreApi\Schemas\ExtendSchema', '7.4.0' );
			return $container->get( StoreApi::class )::container()->get( \Automattic\WooCommerce\StoreApi\Schemas\ExtendSchema::class );
		}
	);
	$this->container->register(
		'Automattic\WooCommerce\Blocks\StoreApi\SchemaController',
		function( Container $container ) {
			$this->deprecated_dependency( 'Automattic\WooCommerce\Blocks\StoreApi\SchemaController', '7.2.0', 'Automattic\WooCommerce\StoreApi\SchemaController', '7.4.0' );
			return $container->get( StoreApi::class )::container()->get( SchemaController::class );
		}
	);
	$this->container->register(
		'Automattic\WooCommerce\Blocks\StoreApi\RoutesController',
		function( Container $container ) {
			$this->deprecated_dependency( 'Automattic\WooCommerce\Blocks\StoreApi\RoutesController', '7.2.0', 'Automattic\WooCommerce\StoreApi\RoutesController', '7.4.0' );
			return $container->get( StoreApi::class )::container()->get( RoutesController::class );
		}
	);
	$this->container->register(
		BlockPatterns::class,
		function () {
			return new BlockPatterns( $this->package );
		}
	);
}