Automattic\WooCommerce\Internal\DependencyManagement

AbstractServiceProvider::share()protectedWC 1.0

Register a shared entry in the container (get always returns the same instance).

Метод класса: AbstractServiceProvider{}

Хуков нет.

Возвращает

DefinitionInterface. The generated container definition.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->share( $id, $concrete ) : DefinitionInterface;
$id(строка) (обязательный)
Entry id (typically a class or interface name).
$concrete(разное|null)
Concrete entity to register under that id, null for automatic creation.
По умолчанию: null

Код AbstractServiceProvider::share() WC 8.7.0

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