AbstractServiceProvider::share_with_auto_arguments( string $class_name, mixed $concrete = null )

Register a class in the container and use reflection to guess the injection method arguments.


Description Description

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.


Parameters Parameters

$class_name

(Required) Class name to register.

$concrete

(Optional) The concrete to register. Can be a shared instance, a factory callback, or a class name.

Default value: null


Top ↑

Return Return

(AutomatticWooCommerceVendorLeagueContainerDefinitionDefinitionInterface) The generated container definition.


Top ↑

Source Source

File: src/Internal/DependencyManagement/AbstractServiceProvider.php


			


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.