Menu

## MiddlewareChain
in package
Uses Microable, Containable

MiddlewareChain.php : 15

### Table of Contents

#### Properties

$context : ContainerInterface|Container|null
  Application container context
$macros : array<string|int, mixed>
$middlewareContainer : Arrayable

#### Methods

__call() : mixed
  Dynamically handle calls to the class.
__callStatic() : mixed
  Dynamically handle calls to the class.
__construct() : mixed
add() : MiddlewareChain
  Add a middleware to the middleware chain
addAfter() : MiddlewareChain
  Add a middleware to the middleware chain after a specific middleware
addBefore() : MiddlewareChain
  Add a middleware before another middleware
flushMacros() : void
  Remove all the macros we had registered
get() : array<string|int, mixed>
  Get the middleware chain
getOrDefault() : mixed
  Get a value from the container or return a default value
getOrFail() : mixed
getSilently() : mixed
hasMacro() : bool
  Check if we have a method in the balonables
macro() : void
  Add a new mixable to the macros
mixin() : void
  Mix another object into the class.
next() : void
  Run the next middleware in the chain
rail() : void
  Run the middleware chain
set() : void
  Set a value in the container
contextHas() : bool
asMiddleware() : MiddlewareContract
isAMiddleware() : bool

### Properties

#### $context

Containable.php : 20

Application container context

`public ContainerInterface|Container|null $context`

#### $macros

Microable.php : 14
`protected static array<string|int, mixed> $macros = []`

#### $middlewareContainer

MiddlewareChain.php : 20
`private Arrayable $middlewareContainer`

### Methods

#### __call()

Microable.php : 101

Dynamically handle calls to the class.

`public __call(string $method, array<string|int, mixed> $parameters) : mixed`

##### Parameters

$method : string
$parameters : array<string|int, mixed>

##### Tags

throws
  BadMethodCallException

#### __callStatic()

Microable.php : 75

Dynamically handle calls to the class.

`public static __callStatic(string $method, array<string|int, mixed> $parameters) : mixed`

##### Parameters

$method : string
$parameters : array<string|int, mixed>

##### Tags

throws
  BadMethodCallException

#### __construct()

MiddlewareChain.php : 33
`public __construct(PioniaApplication $app) : mixed`

##### Parameters

$app : PioniaApplication

#### add()

MiddlewareChain.php : 27

Add a middleware to the middleware chain

`public add(string $middleware) : MiddlewareChain`

##### Parameters

$middleware : string

##### Return values

MiddlewareChain

#### addAfter()

MiddlewareChain.php : 56

Add a middleware to the middleware chain after a specific middleware

`public addAfter(string $middlewareSearch, string $middlewareToInsert) : MiddlewareChain`

##### Parameters

$middlewareSearch : string

  The target middleware in the chain

$middlewareToInsert : string

  The new middleware we are registering

##### Return values

MiddlewareChain

#### addBefore()

MiddlewareChain.php : 71

Add a middleware before another middleware

`public addBefore(string $middlewareSearch, string $middlewareToInsert) : MiddlewareChain`

##### Parameters

$middlewareSearch : string

  The target middleware in the chain

$middlewareToInsert : string

  The new middleware we are registering

##### Tags

throws
  Exception

##### Return values

MiddlewareChain

#### flushMacros()

Microable.php : 61

Remove all the macros we had registered

`public static flushMacros() : void`

#### get()

MiddlewareChain.php : 44

Get the middleware chain

`public get() : array<string|int, mixed>`

##### Return values

array<string|int, mixed>

#### getOrDefault()

Containable.php : 51

Get a value from the container or return a default value

`public getOrDefault(string $key, mixed $default) : mixed`

##### Parameters

$key : string
$default : mixed

#### getOrFail()

Containable.php : 60
`public getOrFail(mixed $key) : mixed`

##### Parameters

$key : mixed

##### Tags

throws
  ContainerExceptionInterface
throws
  NotFoundExceptionInterface

#### getSilently()

Containable.php : 36
`public getSilently(mixed $key) : mixed`

##### Parameters

$key : mixed

#### hasMacro()

Microable.php : 53

Check if we have a method in the balonables

`public static hasMacro(string $name) : bool`

##### Parameters

$name : string

##### Return values

bool

#### macro()

Microable.php : 22

Add a new mixable to the macros

`public static macro(string $key, $value) : void`

##### Parameters

$key : string
$value :

#### mixin()

Microable.php : 35

Mix another object into the class.

`public static mixin(object $mixin[, bool $replace = true ]) : void`

##### Parameters

$mixin : object
$replace : bool = true

##### Tags

throws
  ReflectionException

#### next()

MiddlewareChain.php : 103

Run the next middleware in the chain

`public next(Request $request, Response $response, MiddlewareChain $chain) : void`

##### Parameters

$request : Request
$response : Response
$chain : MiddlewareChain

#### rail()

MiddlewareChain.php : 88

Run the middleware chain

`public rail(Request $request, Response $response) : void`

##### Parameters

$request : Request
$response : Response

#### set()

Containable.php : 31

Set a value in the container

`public set(string $name, mixed $value) : void`

##### Parameters

$name : string
$value : mixed

#### contextHas()

Containable.php : 23
`protected contextHas(string $key) : bool`

##### Parameters

$key : string

##### Return values

bool

#### asMiddleware()

MiddlewareChain.php : 114
`private asMiddleware(mixed $klass) : MiddlewareContract`

##### Parameters

$klass : mixed

##### Return values

MiddlewareContract

#### isAMiddleware()

MiddlewareChain.php : 109
`private isAMiddleware(mixed $class) : bool`

##### Parameters

$class : mixed

##### Return values

bool

## Search results