class Middleware

internal  
 

Properties

protected Transaction|null $transaction

The current active transaction.

protected Span|null $appSpan

The span for the app.handle part of the application.

Methods

Response
handle(Request $request, Closure $next)

Handle an incoming request.

void
terminate(Request $request, Response $response)

Perform cleanup after the response has been sent.

static void
setBootedTimestamp(float|null $timestamp = null)

Set the timestamp of application bootstrap completion.

static void
signalRouteWasMatched()

Signal that a route was matched for the current request.

void
finishTransaction()

Finish the current transaction.

static void
flushState()

Flush all static state.

Details

at line 53
Response handle(Request $request, Closure $next)

Handle an incoming request.

Parameters

Request $request
Closure $next

Return Value

Response

at line 70
void terminate(Request $request, Response $response)

Perform cleanup after the response has been sent.

The transaction is not finished here — it stays open to capture spans created by after-response work (e.g. dispatchAfterResponse). A Coroutine::defer() registered in startTransaction() finishes the transaction when the coroutine exits, after all deferred work completes.

Parameters

Request $request
Response $response

Return Value

void

at line 98
static void setBootedTimestamp(float|null $timestamp = null)

internal  this method should only be invoked right after the application has finished "booting"
 

Set the timestamp of application bootstrap completion.

Boot-only. Sets a process-wide static used by the first-request boot span. Runtime use would race across coroutines.

Parameters

float|null $timestamp

Return Value

void

at line 106
static void signalRouteWasMatched()

Signal that a route was matched for the current request.

Return Value

void

at line 118
void finishTransaction()

Finish the current transaction.

Return Value

void

at line 289
static void flushState()

Flush all static state.

Return Value

void