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, $methodIsRequired, string | null $methodClass) : bool
Parameters
$instance
object
$method
string
$params
array
$alias
string
$methodIsRequired
$methodClass
stringnull
Returns
bool
Resolve parameters referencing other services
resolveMethodParameters(string $class, string $method, array $callTimeUserParams, string $alias, int | bool $methodRequirementType, bool $isInstantiator) : array
Inherited
inherited_from |
\Zend\Di\Di::resolveMethodParameters() |
Parameters
$class
string
$method
string
$callTimeUserParams
array
$alias
string
$methodRequirementType
intbool
$isInstantiator
bool
Exceptions
Returns
array
Properties
All the dependenent aliases
$currentAliasDependenencies : array
Inherited
inherited_from |
\Zend\Di\Di::$$currentAliasDependenencies |
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 |
Constants
resolve mode RESOLVE_EAGER
METHOD_IS_AWARE
Inherited
inherited_from |
\Zend\Di\Di::METHOD_IS_AWARE |
resolve mode RESOLVE_EAGER | RESOLVE_STRICT
METHOD_IS_CONSTRUCTOR
Inherited
inherited_from |
\Zend\Di\Di::METHOD_IS_CONSTRUCTOR |
resolve mode RESOLVE_EAGER
METHOD_IS_EAGER
Inherited
inherited_from |
\Zend\Di\Di::METHOD_IS_EAGER |
resolve mode RESOLVE_EAGER | RESOLVE_STRICT
METHOD_IS_INSTANTIATOR
Inherited
inherited_from |
\Zend\Di\Di::METHOD_IS_INSTANTIATOR |
use only specified parameters
METHOD_IS_OPTIONAL
Inherited
inherited_from |
\Zend\Di\Di::METHOD_IS_OPTIONAL |
resolve mode RESOLVE_EAGER | RESOLVE_STRICT
METHOD_IS_REQUIRED
Inherited
inherited_from |
\Zend\Di\Di::METHOD_IS_REQUIRED |
Resolve method policy
RESOLVE_EAGER
Inherited
EAGER: explore type preference or go through
inherited_from |
\Zend\Di\Di::RESOLVE_EAGER |
Resolve method policy
RESOLVE_STRICT
Inherited
STRICT: explore type preference or throw exception
inherited_from |
\Zend\Di\Di::RESOLVE_STRICT |