Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250706) (a6b17d8f6bd)
Slim\MiddlewareDispatcher Class Reference
Inheritance diagram for Slim\MiddlewareDispatcher:
Slim\Interfaces\MiddlewareDispatcherInterface Psr\Http\Server\RequestHandlerInterface

Public Member Functions

 __construct (RequestHandlerInterface $kernel, ?CallableResolverInterface $callableResolver=null, ?ContainerInterface $container=null)
 
 add ($middleware)
 Add a new middleware to the stack.
 
 addCallable (callable $middleware)
 Add a (non-standard) callable middleware to the stack.
 
 addDeferred (string $middleware)
 Add a new middleware by class name.
 
 addMiddleware (MiddlewareInterface $middleware)
 Add a new middleware to the stack.
 
 handle (ServerRequestInterface $request)
 Invoke the middleware stack.
 
 seedMiddlewareStack (RequestHandlerInterface $kernel)
 {Seed the middleware stack with the inner request handler.}
 

Protected Attributes

CallableResolverInterface $callableResolver
 
ContainerInterface $container
 
RequestHandlerInterface $tip
 Tip of the middleware call stack.
 

Member Function Documentation

◆ add()

Slim\MiddlewareDispatcher::add ( $middleware)

Add a new middleware to the stack.

Middleware are organized as a stack. That means middleware that have been added before will be executed after the newly added one (last in, first out).

Parameters
MiddlewareInterface | string | callable$middleware

Implements Slim\Interfaces\MiddlewareDispatcherInterface.

◆ addCallable()

Slim\MiddlewareDispatcher::addCallable ( callable $middleware)

Add a (non-standard) callable middleware to the stack.

Middleware are organized as a stack. That means middleware that have been added before will be executed after the newly added one (last in, first out).

◆ addDeferred()

Slim\MiddlewareDispatcher::addDeferred ( string $middleware)

Add a new middleware by class name.

Middleware are organized as a stack. That means middleware that have been added before will be executed after the newly added one (last in, first out).

◆ addMiddleware()

Slim\MiddlewareDispatcher::addMiddleware ( MiddlewareInterface $middleware)

Add a new middleware to the stack.

Middleware are organized as a stack. That means middleware that have been added before will be executed after the newly added one (last in, first out).

Implements Slim\Interfaces\MiddlewareDispatcherInterface.

◆ handle()

Slim\MiddlewareDispatcher::handle ( ServerRequestInterface $request)

Invoke the middleware stack.

Implements Psr\Http\Server\RequestHandlerInterface.

◆ seedMiddlewareStack()

Slim\MiddlewareDispatcher::seedMiddlewareStack ( RequestHandlerInterface $kernel)

{Seed the middleware stack with the inner request handler.}

Implements Slim\Interfaces\MiddlewareDispatcherInterface.


The documentation for this class was generated from the following file: