Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Add new classes to bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Apr 22, 2021
1 parent e0f144c commit b14625a
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/Domain/Bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
namespace Automattic\WooCommerce\Blocks\Domain;

use Automattic\WooCommerce\Blocks\Assets as BlockAssets;
use Automattic\WooCommerce\Blocks\AssetsController as AssetsController;
use Automattic\WooCommerce\Blocks\Assets\Api as AssetApi;
use Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry;
use Automattic\WooCommerce\Blocks\Library;
use Automattic\WooCommerce\Blocks\BlockTypesController;
use Automattic\WooCommerce\Blocks\Installer;
use Automattic\WooCommerce\Blocks\Registry\Container;
use Automattic\WooCommerce\Blocks\RestApi;
Expand Down Expand Up @@ -81,15 +81,15 @@ protected function init() {
$this->add_build_notice();
$this->container->get( AssetDataRegistry::class );
$this->container->get( Installer::class );
BlockAssets::init();
$this->container->get( AssetsController::class );
}
$this->container->get( DraftOrders::class )->init();
$this->container->get( CreateAccount::class )->init();
$this->container->get( ExtendRestApi::class );
$this->container->get( PaymentsApi::class );
$this->container->get( RestApi::class );
$this->container->get( GoogleAnalytics::class );
Library::init();
$this->container->get( BlockTypesController::class );
}

/**
Expand Down Expand Up @@ -157,6 +157,12 @@ 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 ) {
Expand All @@ -183,6 +189,14 @@ 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 ) {
Expand Down

0 comments on commit b14625a

Please sign in to comment.