class ServerFactory

Properties

protected LoggerInterface|null $logger
protected Dispatcher|null $eventDispatcher
protected ServerInterface|null $server
protected ServerConfig|null $config

Methods

__construct(Container $container)

No description

void
configure(array $config)

Configure the server with the given config array.

void
start()

Start the server.

getServer()

Get the server instance.

setServer(ServerInterface $server)

Set the server instance.

getEventDispatcher()

Get the event dispatcher instance.

setEventDispatcher(Dispatcher $eventDispatcher)

Set the event dispatcher instance.

LoggerInterface
getLogger()

Get the logger instance.

setLogger(LoggerInterface $logger)

Set the logger instance.

getConfig()

Get the server configuration.

Details

at line 23
__construct(Container $container)

No description

Parameters

Container $container

at line 30
void configure(array $config)

Configure the server with the given config array.

Parameters

array $config

Return Value

void

at line 40
void start()

Start the server.

Return Value

void

at line 48
ServerInterface getServer()

Get the server instance.

Return Value

ServerInterface

at line 67
ServerFactory setServer(ServerInterface $server)

Set the server instance.

Boot-only. Mutates the shared ServerFactory before startup; runtime use races across coroutines and changes the server used by later calls.

Parameters

ServerInterface $server

Return Value

ServerFactory

at line 76
Dispatcher getEventDispatcher()

Get the event dispatcher instance.

Return Value

Dispatcher

at line 90
ServerFactory setEventDispatcher(Dispatcher $eventDispatcher)

Set the event dispatcher instance.

Boot-only. Set before configure(); the constructed Server captures this dispatcher and does not pick up later changes.

Parameters

Dispatcher $eventDispatcher

Return Value

ServerFactory

at line 99
LoggerInterface getLogger()

Get the logger instance.

Return Value

LoggerInterface

at line 113
ServerFactory setLogger(LoggerInterface $logger)

Set the logger instance.

Boot-only. Set before configure(); the constructed Server captures this logger and does not pick up later changes.

Parameters

LoggerInterface $logger

Return Value

ServerFactory

at line 122
ServerConfig|null getConfig()

Get the server configuration.

Return Value

ServerConfig|null