AbstractServiceProvider::share()protectedWC 1.0

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

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

No Hooks.


DefinitionInterface. The generated container definition.


// protected - for code of main (parent) or child class
$result = $this->share( $id, $concrete ) : DefinitionInterface;
$id(string) (required)
Entry id (typically a class or interface name).
Concrete entity to register under that id, null for automatic creation.
Default: null

Код AbstractServiceProvider::share() WC 7.1.0

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