Automattic\WooCommerce\Internal\DependencyManagement\ServiceProviders

UtilsClassesServiceProvider{}WC 1.0

Service provider for the non-static utils classes in the Automattic\WooCommerce\src namespace.

No Hooks.

Usage

$UtilsClassesServiceProvider = new UtilsClassesServiceProvider();
// use class methods

Methods

  1. public register()

Код UtilsClassesServiceProvider{} WC 7.1.0

class UtilsClassesServiceProvider extends AbstractServiceProvider {

	/**
	 * The classes/interfaces that are serviced by this service provider.
	 *
	 * @var array
	 */
	protected $provides = array(
		DatabaseUtil::class,
		HtmlSanitizer::class,
		OrderUtil::class,
		PluginUtil::class,
		COTMigrationUtil::class,
	);

	/**
	 * Register the classes.
	 */
	public function register() {
		$this->share( DatabaseUtil::class );
		$this->share( HtmlSanitizer::class );
		$this->share( OrderUtil::class );
		$this->share( PluginUtil::class )
			->addArgument( LegacyProxy::class );
		$this->share( COTMigrationUtil::class )
			->addArguments( array( CustomOrdersTableController::class, DataSynchronizer::class ) );
	}
}