ServiceLocator
in package
implements
ServiceProviderInterface
Uses
ServiceLocatorTrait
Tags
Table of Contents
Interfaces
- ServiceProviderInterface
- A ServiceProviderInterface exposes the identifiers and the types of services provided by a container.
Properties
- $container : mixed
- $externalId : string|null
- $factories : array<string|int, mixed>
- $loading : array<string|int, mixed>
- $providedTypes : array<string|int, mixed>
Methods
- __construct() : mixed
- __invoke() : mixed
- get() : mixed
- {@inheritdoc}
- getProvidedServices() : array<string|int, mixed>
- {@inheritdoc}
- has() : bool
- {@inheritdoc}
- createCircularReferenceException() : ContainerExceptionInterface
- createNotFoundException() : NotFoundExceptionInterface
- formatAlternatives() : string
Properties
$container
private
mixed
$container
= null
$externalId
private
string|null
$externalId
= null
$factories
private
array<string|int, mixed>
$factories
$loading
private
array<string|int, mixed>
$loading
= []
$providedTypes
private
array<string|int, mixed>
$providedTypes
Methods
__construct()
public
__construct(array<string|int, callable> $factories) : mixed
Parameters
- $factories : array<string|int, callable>
__invoke()
public
__invoke(string $id) : mixed
Parameters
- $id : string
get()
{@inheritdoc}
public
get(string $id) : mixed
Parameters
- $id : string
getProvidedServices()
{@inheritdoc}
public
getProvidedServices() : array<string|int, mixed>
Return values
array<string|int, mixed>has()
{@inheritdoc}
public
has(string $id) : bool
Parameters
- $id : string
Return values
boolcreateCircularReferenceException()
private
createCircularReferenceException(string $id, array<string|int, mixed> $path) : ContainerExceptionInterface
Parameters
- $id : string
- $path : array<string|int, mixed>
Return values
ContainerExceptionInterfacecreateNotFoundException()
private
createNotFoundException(string $id) : NotFoundExceptionInterface
Parameters
- $id : string
Return values
NotFoundExceptionInterfaceformatAlternatives()
private
formatAlternatives([array<string|int, mixed> $alternatives = null ][, string $separator = 'and' ]) : string
Parameters
- $alternatives : array<string|int, mixed> = null
- $separator : string = 'and'