Container
in package
Class Container is a simple dependency injection container.
Table of Contents
- $instances : array<string|int, mixed>
- A list of created instances
- $services : array<string|int, mixed>
- A list of registered services
- get() : T
- Method for getting a registered service
- set() : void
- The method for registering a new service
Properties
$instances
A list of created instances
protected
array<string|int, mixed>
$instances
= array()
$services
A list of registered services
protected
array<string|int, mixed>
$services
= array()
Methods
get()
Method for getting a registered service
public
get(class-string<\MailPoet\EmailEditor\T> $name) : T
Parameters
- $name : class-string<\MailPoet\EmailEditor\T>
-
The name of the service.
Tags
Return values
T —set()
The method for registering a new service
public
set(string $name, callable $callback) : void
Parameters
- $name : string
-
The name of the service.
- $callback : callable
-
The callable that will be used to create the service.