AbstractServiceProvider::share_with_auto_arguments()protectedWC 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.

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

Хуков нет.


DefinitionInterface. The generated container definition.


// protected - в коде основоного (родительского) или дочернего класса
$result = $this->share_with_auto_arguments( $class_name, $concrete ) : DefinitionInterface;
$class_name(строка) (обязательный)
Class name to register.
The concrete to register. Can be a shared instance, a factory callback, or a class name.
По умолчанию: null

Код AbstractServiceProvider::share_with_auto_arguments() WC 8.9.3

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