Documentation

Manager extends AbstractManager
in package

Middleware manager class

Tags
category

Pop

author

Nick Sagona, III dev@noladev.com

copyright

Copyright (c) 2009-2026 NOLA Interactive, LLC.

license

https://www.popphp.org/license New BSD License

version
4.4.0

Table of Contents

Properties

$handlers  : array<string|int, mixed>
Handlers
$items  : array<string|int, mixed>
Manager items

Methods

__construct()  : mixed
Constructor
__get()  : mixed
Get an item
__isset()  : bool
Determine if an item exists
__set()  : void
Set an item
__unset()  : void
Unset an item
addHandler()  : static
Add a handler
addHandlers()  : static
Add handlers
addItem()  : static
Add an item
addItems()  : static
Add items
count()  : int
Return count
getHandler()  : mixed
Get a handler
getHandlers()  : array<string|int, mixed>
Get handlers
getItem()  : mixed
Get an item
getItems()  : array<string|int, mixed>
Get items
getIterator()  : ArrayIterator
Get iterator
handle()  : mixed
Recursive method to execute all middleware handlers
hasHandler()  : bool
Determine whether the manager has a handler
hasHandlers()  : bool
Determine whether the manager has handlers
hasItem()  : bool
Determine whether the manager has an item
hasItems()  : bool
Determine whether the manager has items
offsetExists()  : bool
Determine if an item exists
offsetGet()  : mixed
Get an item
offsetSet()  : void
Set an item
offsetUnset()  : void
Unset an item
process()  : static
Process all middleware
removeHandler()  : static
Remove a handler
removeItem()  : static
Remove an item
setItems()  : static
Set items
terminate()  : void
Execute all middleware handlers terminate methods

Properties

$handlers

Handlers

protected static array<string|int, mixed> $handlers = []

Methods

__construct()

Constructor

public __construct([array<string|int, mixed>|null $handlers = null ]) : mixed

Instantiate the middleware manager object.

Parameters
$handlers : array<string|int, mixed>|null = null

__get()

Get an item

public __get(string $name) : mixed
Parameters
$name : string

__isset()

Determine if an item exists

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__set()

Set an item

public __set(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed

__unset()

Unset an item

public __unset(string $name) : void
Parameters
$name : string

addHandler()

Add a handler

public addHandler(mixed $handler[, mixed $name = null ]) : static
Parameters
$handler : mixed
$name : mixed = null
Return values
static

addHandlers()

Add handlers

public addHandlers(array<string|int, mixed> $handlers) : static
Parameters
$handlers : array<string|int, mixed>
Return values
static

addItem()

Add an item

public addItem(mixed $item[, mixed $name = null ]) : static
Parameters
$item : mixed
$name : mixed = null
Return values
static

addItems()

Add items

public addItems(array<string|int, mixed> $items) : static
Parameters
$items : array<string|int, mixed>
Return values
static

getHandler()

Get a handler

public getHandler(mixed $name) : mixed
Parameters
$name : mixed

getHandlers()

Get handlers

public getHandlers() : array<string|int, mixed>
Return values
array<string|int, mixed>

getItem()

Get an item

public getItem(mixed $name) : mixed
Parameters
$name : mixed

getItems()

Get items

public getItems() : array<string|int, mixed>
Return values
array<string|int, mixed>

getIterator()

Get iterator

public getIterator() : ArrayIterator
Return values
ArrayIterator

handle()

Recursive method to execute all middleware handlers

public static handle(mixed $request, Closure $dispatch[, mixed $dispatchParams = null ]) : mixed
Parameters
$request : mixed
$dispatch : Closure
$dispatchParams : mixed = null

hasHandler()

Determine whether the manager has a handler

public hasHandler(string $name) : bool
Parameters
$name : string
Return values
bool

hasHandlers()

Determine whether the manager has handlers

public hasHandlers() : bool
Return values
bool

hasItem()

Determine whether the manager has an item

public hasItem(string $name) : bool
Parameters
$name : string
Return values
bool

hasItems()

Determine whether the manager has items

public hasItems() : bool
Return values
bool

offsetExists()

Determine if an item exists

public offsetExists(string $offset) : bool
Parameters
$offset : string
Return values
bool

offsetGet()

Get an item

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

offsetSet()

Set an item

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

offsetUnset()

Unset an item

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

process()

Process all middleware

public process(mixed $request, Closure $dispatch[, mixed $dispatchParams = null ]) : static
Parameters
$request : mixed
$dispatch : Closure
$dispatchParams : mixed = null
Return values
static

removeHandler()

Remove a handler

public removeHandler(mixed $name) : static
Parameters
$name : mixed
Return values
static

removeItem()

Remove an item

public removeItem(mixed $name) : static
Parameters
$name : mixed
Return values
static

setItems()

Set items

public setItems(array<string|int, mixed> $items) : static
Parameters
$items : array<string|int, mixed>
Return values
static

terminate()

Execute all middleware handlers terminate methods

public static terminate(array<string|int, mixed> $handlers[, mixed $request = null ][, mixed $response = null ]) : void
Parameters
$handlers : array<string|int, mixed>
$request : mixed = null
$response : mixed = null

        
On this page

Search results