trait SortsMiddlewareTrait (View source)

Provide middleware sorting.

Methods

array
getMiddlewarePriority()

Get middleware execution priority.

void
setMiddlewarePriority(array $middleware_priority)

Set middleware execution priority.

integer
getMiddlewarePriorityForMiddleware(string|array $middleware)

Get priority for a specific middleware.

array
sortMiddleware(array $middleware)

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

Details

array getMiddlewarePriority()

Get middleware execution priority.

Return Value

array

void setMiddlewarePriority(array $middleware_priority)

Set middleware execution priority.

Parameters

array $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(array $middleware)

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

Parameters

array $middleware

Return Value

array