Documentation

Container
in package
implements ContainerInterface

A simple implementation of a container.

Tags
experimental

This class is experimental and does not fall under our BC promise

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

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

has()

Returns true if the container can return an entry for the given identifier.

public has(string $id) : bool
Parameters
$id : string
Tags
throws
InvalidArgumentException
Return values
bool

Search results