ServiceLocator
in package
implements
ServiceProviderInterface, Countable
uses
ServiceLocatorTrait
Tags
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
$container
private
Container|null
$container
= null
$externalId
private
string|null
$externalId
= null
$loading
private
array<string|int, mixed>
$loading
= []
$providedTypes
private
array<string|int, mixed>
$providedTypes
Methods
__construct()
public
__construct(array<string, callable> $factories) : mixed
Parameters
- $factories : array<string, callable>
__invoke()
public
__invoke(string $id) : mixed
Parameters
- $id : string
count()
public
count() : int
Return values
intget()
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
TgetProvidedServices()
public
getProvidedServices() : array<string|int, mixed>
Return values
array<string|int, mixed>has()
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>|null $alternatives = null ][, string $separator = 'and' ]) : string
Parameters
- $alternatives : array<string|int, mixed>|null = null
- $separator : string = 'and'