SharedType
extends AbstractDependencyType
in package
A definition for the SharedType dependency type.
Tags
Table of Contents
- $callable_or_value : mixed
- Holds a callable or value provided for this type.
- $shared_instance : mixed
- Holds a cached instance of the value stored (or returned) internally.
- __construct() : mixed
- Constructor
- get() : mixed
- Returns the internal stored and shared value after initial generation.
- resolve_value() : mixed
- Resolver for the internal dependency value.
Properties
$callable_or_value
Holds a callable or value provided for this type.
private
mixed
$callable_or_value
$shared_instance
Holds a cached instance of the value stored (or returned) internally.
private
mixed
$shared_instance
Methods
__construct()
Constructor
public
__construct(mixed $callable_or_value) : mixed
Parameters
- $callable_or_value : mixed
-
A callable or value for the dependency type instance.
Return values
mixed —get()
Returns the internal stored and shared value after initial generation.
public
get(Container $container) : mixed
Parameters
- $container : Container
-
An instance of the dependency injection container.
Return values
mixed —resolve_value()
Resolver for the internal dependency value.
protected
resolve_value(Container $container) : mixed
Parameters
- $container : Container
-
The Dependency Injection Container.