WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Internal\DependencyManagement

AbstractServiceProvider::share_with_auto_arguments() protected WC 1.0

Register a class in the container and use reflection to guess the injection method arguments. The class is registered as shared, so get on the container always returns the same instance.

WARNING: this method uses reflection, so please have performance in mind when using it.

{} It's a 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->share_with_auto_arguments( $class_name, $concrete ) : DefinitionInterface;
$class_name(string) (required)
Class name to register.
$concrete(mixed)
The concrete to register. Can be a shared instance, a factory callback, or a class name.
Default: null

Code of AbstractServiceProvider::share_with_auto_arguments() WC 5.9.0

protected function share_with_auto_arguments( string $class_name, $concrete = null ) : DefinitionInterface {
	return $this->add_with_auto_arguments( $class_name, $concrete, true );
}