Overview
  • Namespace
  • Class

Namespaces

  • Slim
    • Exception
    • Handlers
      • Strategies
    • Http
    • Interfaces
      • Http

Classes

  • App
  • CallableResolver
  • Collection
  • Container
  • DefaultServicesProvider
  • DeferredCallable
  • Routable
  • Route
  • RouteGroup
  • Router

Traits

  • CallableResolverAwareTrait
  • MiddlewareAwareTrait

Trait MiddlewareAwareTrait

Middleware

This is an internal class that enables concentric middleware layers. This class is an implementation detail and is used only inside of the Slim application; it is not visible to—and should not be used by—end users.

Direct Known Users

Slim\App, Slim\Route

Namespace: Slim
Located at MiddlewareAwareTrait.php

Methods summary

protected static
# addMiddleware( callable $callable )

Add middleware

Add middleware

This method prepends new middleware to the application middleware stack.

Parameters

$callable

Any callable that accepts three arguments: 1. A Request object 2. A Response object 3. A "next" middleware callable

Returns

static

Throws

RuntimeException
If middleware is added while the stack is dequeuing
UnexpectedValueException
If the middleware doesn't return a Psr\Http\Message\ResponseInterface
protected
# seedMiddlewareStack( callable $kernel = null )

Seed middleware stack with first callable

Seed middleware stack with first callable

Parameters

$kernel
The last item to run as middleware

Throws

RuntimeException
if the stack is seeded more than once
public Psr\Http\Message\ResponseInterface
# callMiddlewareStack( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response )

Call middleware stack

Call middleware stack

Parameters

$request
A request object
$response
A response object

Returns

Psr\Http\Message\ResponseInterface

Properties summary

protected SplStack $stack

Middleware call stack

Middleware call stack

Link

http://php.net/manual/class.splstack.php
#
protected boolean $middlewareLock

Middleware stack lock

Middleware stack lock

# false
API documentation generated by ApiGen