class Application

Front Controller.

Traits

Strict class for better experience.

Properties

int $maxLoop
bool $catchExceptions
string|null $errorPresenter
callable[] $onStartup
callable[] $onShutdown
callable[] $onRequest
callable[] $onPresenter
callable[] $onResponse
callable[] $onError

Methods

__construct(IPresenterFactory $presenterFactory, Router $router, IRequest $httpRequest, IResponse $httpResponse)

No description

void
run()

Dispatch a HTTP request to a front controller.

createInitialRequest()

No description

void
processRequest(Request $request)

No description

void
processException(Throwable $e)

No description

array
getRequests()

Returns all processed requests.

IPresenter|null
getPresenter()

Returns current presenter.

getRouter()

Returns router.

getPresenterFactory()

Returns presenter factory.

Details

at line 69
__construct(IPresenterFactory $presenterFactory, Router $router, IRequest $httpRequest, IResponse $httpResponse)

Parameters

IPresenterFactory $presenterFactory
Router $router
IRequest $httpRequest
IResponse $httpResponse

at line 81
void run()

Dispatch a HTTP request to a front controller.

Return Value

void

at line 106
Request createInitialRequest()

Return Value

Request

at line 129
void processRequest(Request $request)

Parameters

Request $request

Return Value

void

at line 161
void processException(Throwable $e)

Parameters

Throwable $e

Return Value

void

at line 187
final array getRequests()

Returns all processed requests.

Return Value

array

at line 196
final IPresenter|null getPresenter()

Returns current presenter.

Return Value

IPresenter|null

at line 208
Router getRouter()

Returns router.

Return Value

Router

at line 217
IPresenterFactory getPresenterFactory()

Returns presenter factory.

Return Value

IPresenterFactory