Automattic\WooCommerce\Internal\DependencyManagement

AbstractServiceProvider::add()protectedWC 1.0

Register an entry in the container.

Method of the class: AbstractServiceProvider{}

No Hooks.

Return

DefinitionInterface. The generated container definition.

Usage

// protected - for code of main (parent) or child class
$result = $this->add( $id, $concrete, $shared ) : DefinitionInterface;
$id(string) (required)
Entry id (typically a class or interface name).
$concrete(mixed|null)
Concrete entity to register under that id, null for automatic creation.
Default: null
$shared(true|false|null)
Whether to register the class as shared (get always returns the same instance) or not.
Default: null

AbstractServiceProvider::add() code WC 8.7.0

protected function add( string $id, $concrete = null, bool $shared = null ) : DefinitionInterface {
	return $this->getContainer()->add( $id, $concrete, $shared );
}