Documentation

ServiceLocator
in package
implements ServiceProviderInterface, Countable uses ServiceLocatorTrait

Tags
author

Robin Chalas robin.chalas@gmail.com

author

Nicolas Grekas p@tchwork.com

template-covariant

of mixed

implements

Table of Contents

Interfaces

ServiceProviderInterface
A ServiceProviderInterface exposes the identifiers and the types of services provided by a container.
Countable

Properties

$container  : Container|null
$externalId  : string|null
$loading  : array<string|int, mixed>
$providedTypes  : array<string|int, mixed>

Methods

__construct()  : mixed
__invoke()  : mixed
count()  : int
get()  : T
Finds an entry of the container by its identifier and returns it.
getProvidedServices()  : array<string|int, mixed>
has()  : bool
createCircularReferenceException()  : ContainerExceptionInterface
createNotFoundException()  : NotFoundExceptionInterface
formatAlternatives()  : string

Properties

Methods

__construct()

public __construct(array<string, callable> $factories) : mixed
Parameters
$factories : array<string, callable>

__invoke()

public __invoke(string $id) : mixed
Parameters
$id : string

get()

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

public get(string $id) : T
Parameters
$id : string

Identifier of the entry to look for.

Return values
T

getProvidedServices()

public getProvidedServices() : array<string|int, mixed>
Return values
array<string|int, mixed>

formatAlternatives()

private formatAlternatives([array<string|int, mixed>|null $alternatives = null ][, string $separator = 'and' ]) : string
Parameters
$alternatives : array<string|int, mixed>|null = null
$separator : string = 'and'
Return values
string

        
On this page

Search results