trait SortsMiddlewareTrait (View source)

Provide middleware sorting.

Methods

string[]
getMiddlewarePriority()

Get middleware execution priority.

void
setMiddlewarePriority(string[] $middleware_priority)

Set middleware execution priority.

integer
getMiddlewarePriorityForMiddleware(string|array $middleware)

Get priority for a specific middleware.

array
sortMiddleware(string[] $middleware)

Sort array of fully qualified middleware class names by priority in ascending order.

Details

string[] getMiddlewarePriority()

Get middleware execution priority.

Return Value

string[]

void setMiddlewarePriority(string[] $middleware_priority)

Set middleware execution priority.

Parameters

string[] $middleware_priority

Return Value

void

integer getMiddlewarePriorityForMiddleware(string|array $middleware)

Get priority for a specific middleware.

This is in reverse compared to definition order. Middleware with unspecified priority will yield -1.

Parameters

string|array $middleware

Return Value

integer

array sortMiddleware(string[] $middleware)

Sort array of fully qualified middleware class names by priority in ascending order.

Parameters

string[] $middleware

Return Value

array