Container
class Container
The dependency injection container default implementation.
Properties
array deprecated | $parameters | ||
protected string[] | $aliases | ||
protected array[] | $tags | ||
protected array[] | $wiring |
Methods
No description
No description
No description
No description
No description
Adds the service or its factory to the container.
Removes a service instance from the container.
Returns the service instance. If it has not been created yet, it creates it.
Returns the service instance. If it has not been created yet, it creates it.
Returns type of the service.
Does the service exist?
Has a service instance been created?
Creates new instance of the service.
Returns an instance of the autowired service of the given type. If it has not been created yet, it creates it.
Returns the names of autowired services of the given type.
Returns the names of all services of the given type.
Returns the names of services with the given tag.
Creates an instance of the class and passes dependencies to the constructor using autowiring.
Calls all methods starting with 'inject' and passes dependencies to them via autowiring.
Calls the method and passes dependencies to it via autowiring.
Returns the method name for creating a service.
No description
Details
at line 48
__construct(array $params = [])
No description
at line 55
array
getParameters()
No description
at line 61
mixed
getParameter(string|int $key)
No description
at line 70
protected array
getStaticParameters()
No description
at line 76
protected mixed
getDynamicParameter(string|int $key)
No description
at line 86
Container
addService(string $name, object $service)
Adds the service or its factory to the container.
at line 125
void
removeService(string $name)
Removes a service instance from the container.
at line 136
object
getService(string $name)
Returns the service instance. If it has not been created yet, it creates it.
at line 155
object
getByName(string $name)
Returns the service instance. If it has not been created yet, it creates it.
Alias for getService().
at line 165
string
getServiceType(string $name)
Returns type of the service.
at line 186
bool
hasService(string $name)
Does the service exist?
at line 196
bool
isCreated(string $name)
Has a service instance been created?
at line 211
object
createService(string $name)
Creates new instance of the service.
at line 241
object|null
getByType(string $type, bool $throw = true)
Returns an instance of the autowired service of the given type. If it has not been created yet, it creates it.
at line 271
array
findAutowired(string $type)
internal |
Returns the names of autowired services of the given type.
at line 282
array
findByType(string $type)
Returns the names of all services of the given type.
at line 295
array
findByTag(string $tag)
Returns the names of services with the given tag.
at line 324
object
createInstance(string $class, array $args = [])
Creates an instance of the class and passes dependencies to the constructor using autowiring.
at line 344
void
callInjects(object $service)
Calls all methods starting with 'inject' and passes dependencies to them via autowiring.
at line 353
mixed
callMethod(callable $function, array $args = [])
Calls the method and passes dependencies to it via autowiring.
at line 370
final static string
getMethodName(string $name)
Returns the method name for creating a service.
at line 380
void
initialize()
No description