Container
class Container implements ContainerInterface, ArrayAccess (View source)
Dependency Injection Container that supports different types of entries.
Properties
protected array[] | $entries |
Methods
Container constructor.
Sets the delegate container that is provided for dependency resolution.
Returns PHP code for a cached container that can be loaded quickly on runtime.
Returns value for the container entry with the given identifier.
Tells if the entry with the given identifier exists in the container.
Tells if the entry with the given identifier exists in the container.
Returns value for the container entry with the given identifier.
Adds a container entry with a mixed type.
Removes an entry from the container.
Details
at line 37
__construct()
Container constructor.
at line 48
void
setDelegate(ContainerInterface $delegate)
Sets the delegate container that is provided for dependency resolution.
at line 59
string
getCacheFile(callable $encoder = null)
Returns PHP code for a cached container that can be loaded quickly on runtime.
at line 121
void
addEntry(string $id, EntryInterface $type)
Adds an entry to the container.
at line 137
mixed
get(string $id)
Returns value for the container entry with the given identifier.
at line 182
bool
has(string $id)
Tells if the entry with the given identifier exists in the container.
at line 192
bool
offsetExists(string $offset)
Tells if the entry with the given identifier exists in the container.
at line 204
mixed
offsetGet(string $offset)
Returns value for the container entry with the given identifier.
at line 215
void
offsetSet(string $offset, mixed $value)
Adds a container entry with a mixed type.
at line 224
void
offsetUnset(string $offset)
Removes an entry from the container.