trait CapsuleManagerTrait

Properties

static protected object|null $instance

The current globally used instance.

protected Container $container

The container instance.

Methods

void
setupContainer(Container $container)

Setup the IoC container instance.

void
setAsGlobal()

Make this capsule instance available globally.

getContainer()

Get the IoC container instance.

void
setContainer(Container $container)

Set the IoC container instance.

static void
flushState()

Flush all static state.

Details

at line 25
protected void setupContainer(Container $container)

Setup the IoC container instance.

Parameters

Container $container

Return Value

void

at line 40
void setAsGlobal()

Make this capsule instance available globally.

Boot or tests only. Swaps the global Capsule instance used by static calls; request-time use races across coroutines.

Return Value

void

at line 48
Container getContainer()

Get the IoC container instance.

Return Value

Container

at line 59
void setContainer(Container $container)

Set the IoC container instance.

Boot or tests only. Swaps the Capsule container used by this standalone manager; request-time use races across coroutines.

Parameters

Container $container

Return Value

void

at line 67
static void flushState()

Flush all static state.

Return Value

void