ContainerFactory

Class
Final: Yes

Builds and caches the shared DevTools dependency injection container.

Description

The factory centralizes container bootstrapping so command traits and other internal helpers can resolve services without duplicating bootstrap logic or depending on the console application entrypoint.

Table of Contents

Properties

 : Container|null

Methods

create()

Creates or returns the shared DevTools container instance.

 : ContainerInterface
get()

Resolves a service from the shared DevTools container.

 : mixed|T
has()

Returns whether the shared DevTools container can resolve a service.

 : bool
Properties

$container

Private Static
private static Container|null $container = null
Methods

create()

Public Static

Creates or returns the shared DevTools container instance.

public static create() : ContainerInterface
Return values
ContainerInterface

Description

the shared container instance

get()

Public Static

Resolves a service from the shared DevTools container.

public static get( string|T>  $id) : mixed|T
Parameters
$id : string|T>

Description

the service identifier

Tags
template
Return values
mixed|T

Description

the resolved service

has()

Public Static

Returns whether the shared DevTools container can resolve a service.

public static has( string  $id) : bool
Parameters
$id : string

Description

the service identifier

Return values
bool