Container
in package
implements
ContainerInterface
A simple implementation of a container.
Tags
Interfaces, Classes and Traits
- ContainerInterface
- Describes the interface of a container that exposes methods to read its entries.
Table of Contents
- $definitions : array<string, callable|object|string>
- $services : mixed
- __construct() : mixed
- Create a container object with a set of definitions. The array value MUST produce an object that implements Extension.
- get() : Extension
- Finds an entry of the container by its identifier and returns it.
- has() : bool
- Returns true if the container can return an entry for the given identifier.
Properties
$definitions
private
array<string, callable|object|string>
$definitions
$services
private
mixed
$services
= []
Methods
__construct()
Create a container object with a set of definitions. The array value MUST produce an object that implements Extension.
public
__construct(array<string, callable|object|string> $definitions) : mixed
Parameters
- $definitions : array<string, callable|object|string>
Return values
mixed —get()
Finds an entry of the container by its identifier and returns it.
public
get(string $id) : Extension
Parameters
- $id : string
Tags
Return values
Extension —has()
Returns true if the container can return an entry for the given identifier.
public
has(string $id) : bool
Parameters
- $id : string