\Pimple\Psr11ServiceLocator

Pimple PSR-11 service locator.

Summary

Methods
Properties
Constants
__construct()
get()
has()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$container
$aliases
N/A

Properties

$container

$container : 

Type

$aliases

$aliases : 

Type

Methods

__construct()

__construct(\Pimple\Container  $container, array  $ids) 

Parameters

\Pimple\Container $container

The Container instance used to locate services

array $ids

Array of service ids that can be located. String keys can be used to define aliases

get()

get(string  $id) : mixed

Finds an entry of the container by its identifier and returns it.

Parameters

string $id

Identifier of the entry to look for.

Returns

mixed —

Entry.

has()

has(string  $id) : boolean

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

Returns false otherwise.

has($id) returning true does not mean that get($id) will not throw an exception. It does however mean that get($id) will not throw a NotFoundExceptionInterface.

Parameters

string $id

Identifier of the entry to look for.

Returns

boolean