final class MiddlewareStack implements StackInterface, ApplicationAwareInterface (View source)

The default stack used to keep track of middleware and process requests

Traits

Trait ApplicationAwareTrait A trait used with ApplicationAwareInterface

Properties

protected Application $app from  ApplicationAwareTrait
protected array[] $middleware
protected DispatcherFrame|Mock_BlockController_7fcd43c1|Mock_TrackableBlockController_a75af608 $dispatcher

Methods

setApplication(Application $app)

Setter method for the application

__construct(DelegateInterface $dispatcher = null)

MiddlewareStack constructor.

withDispatcher(DelegateInterface $dispatcher)

Get a stack with the given dispatcher

withMiddleware(MiddlewareInterface $middleware, $priority = 10)

No description

Response
process(Request $request)

No description

callable
getStack()

Reduce middleware into a stack of functions that each call the next

callable
getZipper()

Get the function used to zip up the middleware This function runs as part of the array_reduce routine and reduces the list of middlewares into a single delegate

middlewareGenerator()

Get a generator that converts the stored priority array into a sorted flat list

Details

setApplication(Application $app)

Setter method for the application

Parameters

Application $app

__construct(DelegateInterface $dispatcher = null)

MiddlewareStack constructor.

Dispat

Parameters

DelegateInterface $dispatcher

MiddlewareStack withDispatcher(DelegateInterface $dispatcher)

Get a stack with the given dispatcher

Parameters

DelegateInterface $dispatcher

Return Value

MiddlewareStack

StackInterface withMiddleware(MiddlewareInterface $middleware, $priority = 10)

No description

Parameters

MiddlewareInterface $middleware
$priority

Return Value

StackInterface

StackInterface withoutMiddleware(MiddlewareInterface $middleware)

No description

Parameters

MiddlewareInterface $middleware

Return Value

StackInterface

Response process(Request $request)

No description

Parameters

Request $request

Return Value

Response

private callable getStack()

Reduce middleware into a stack of functions that each call the next

Return Value

callable

private callable getZipper()

Get the function used to zip up the middleware This function runs as part of the array_reduce routine and reduces the list of middlewares into a single delegate

Return Value

callable

private Generator middlewareGenerator()

Get a generator that converts the stored priority array into a sorted flat list

Return Value

Generator