Proxy used to analyze how instances are created by a given Di.
Overrides Zend\Di\Di to produce artifacts that
represent the process used to instantiate a particular instance
Methods
Constructor
__construct(\Zend\Di\Di $di)
Get an object instance from the defined callback
createInstanceViaCallback(\Zend\Di\callable $callback, array $params, string $alias) : \Zend\Di\ServiceLocator\GeneratorInstance
Parameters
$callback
\Zend\Di\callable
$params
array
$alias
string
Exceptions
Returns
Retrieve a class instance based on class name
createInstanceViaConstructor(string $class, array $params, string | null $alias) : \Zend\Di\ServiceLocator\GeneratorInstance
Any parameters provided will be used as constructor arguments. If any
given parameter is a DependencyReference object, it will be fetched
from the container so that the instance may be injected.
Parameters
$class
string
$params
array
$alias
stringnull
Returns
Lazy-load a class
get(string $name, array $params) : \Zend\Di\ServiceLocator\GeneratorInstance
Attempts to load the class (or service alias) provided. If it has been
loaded before, the previous instance will be returned (unless the service
definition indicates shared instances should not be used).
Parameters
$name
string
Class name or service alias
$params
nullarray
Parameters to pass to the constructor
Returns
{@inheritDoc}
handleInjectionMethodForObject($class, $method, $params, $alias, $isRequired)
Parameters
$class
$method
$params
$alias
$isRequired
Inject dependencies
injectDependencies(object $instance, array $params) : void
Inherited
inherited_from |
\Zend\Di\Di::injectDependencies() |
Parameters
$instance
object
$params
array
instanceManager()
instanceManager() : \Zend\Di\InstanceManager
Inherited
inherited_from |
\Zend\Di\Di::instanceManager() |
Returns
Retrieve a new instance of a class
newInstance(mixed $name, array $params, bool $isShared) : \Zend\Di\ServiceLocator\GeneratorInstance
Forces retrieval of a discrete instance of the given class, using the
constructor parameters provided.
Parameters
$name
mixed
Class name or service alias
$params
array
Parameters to pass to the constructor
$isShared
bool
Exceptions
Returns
setDefinitionList()
setDefinitionList(\Zend\Di\DefinitionList $definitions) : \Zend\Di\self
Inherited
inherited_from |
\Zend\Di\Di::setDefinitionList() |
Parameters
Returns
\Zend\Di\self
Set the instance manager
setInstanceManager(\Zend\Di\InstanceManager $instanceManager) : \Zend\Di\Di
Inherited
inherited_from |
\Zend\Di\Di::setInstanceManager() |
Parameters
Returns
getCallParameters()
getCallParameters($name, array $params, string $method) : array
Inherited
inherited_from |
\Zend\Di\Di::getCallParameters() |
Parameters
$name
$params
array
$method
string
Returns
array
Utility method used to retrieve the class of a particular instance.
getClass(Object $instance) : string
This is here to allow extending classes to
override how class names are resolved
Parameters
$instance
Object
Returns
string
handleInjectDependencies()
handleInjectDependencies(object $instance, array $injectionMethods, array $params, string | null $instanceClass, $instanceAlias, string $requestedName)
Inherited
inherited_from |
\Zend\Di\Di::handleInjectDependencies() |
Parameters
$instance
object
$injectionMethods
array
$params
array
$instanceClass
stringnull
$instanceAlias
string|null$instanceAlias
$requestedName
string
Exceptions
Checks if the object has this class as one of its parents
isSubclassOf(string $className, $type) : bool
Inherited
see |
\Zend\Di\https://bugs.php.net/bug.php?id=53727 |
see |
\Zend\Di\https://github.com/zendframework/zf2/pull/1807 |
inherited_from |
\Zend\Di\Di::isSubclassOf() |
Parameters
$className
string
$type
Returns
bool
This parameter will handle any injection methods and resolution of
dependencies for such methods
resolveAndCallInjectionMethodForInstance(object $instance, string $method, array $params, string $alias, bool $methodIsRequired, string | null $methodClass) : bool
Parameters
$instance
object
$method
string
$params
array
$alias
string
$methodIsRequired
bool
$methodClass
stringnull
Returns
bool
Resolve parameters referencing other services
resolveMethodParameters(string $class, string $method, array $callTimeUserParams, string $alias, bool $methodIsRequired, bool $isInstantiator) : array
Inherited
inherited_from |
\Zend\Di\Di::resolveMethodParameters() |
Parameters
$class
string
$method
string
$callTimeUserParams
array
$alias
string
$methodIsRequired
bool
$isInstantiator
bool
Exceptions
Returns
array
Properties
All the class dependencies [source][dependency]
$currentDependencies : array
Inherited
inherited_from |
\Zend\Di\Di::$$currentDependencies |
$instanceContext
$instanceContext : string
Inherited
inherited_from |
\Zend\Di\Di::$$instanceContext |
All the class references [dependency][source]
$references : array
Inherited
inherited_from |
\Zend\Di\Di::$$references |