PHP Class Psr7Middlewares\Middleware

Exibir arquivo Open project: oscarotero/psr7-middlewares Class Usage Examples

Public Methods

Method Description
__callStatic ( string $name, array $args ) Create instances of the middlewares.
create ( callable | string $basePath, callable $factory = null ) : callable Create a middleware callable that acts as a "proxy" to a real middleware that must be returned by the given callback.
getStreamFactory ( ) Set the stream factory used by some middlewares.
registerNamespace ( string $namespace ) Register a new namespace.
setStreamFactory ( callable $streamFactory ) Set the stream factory used by some middlewares.

Method Details

__callStatic() public static method

Create instances of the middlewares.
public static __callStatic ( string $name, array $args )
$name string
$args array

create() public static method

Create a middleware callable that acts as a "proxy" to a real middleware that must be returned by the given callback.
public static create ( callable | string $basePath, callable $factory = null ) : callable
$basePath callable | string The base path in which the middleware is created (optional)
$factory callable Takes no argument and MUST return a middleware callable or false
return callable

getStreamFactory() public static method

Set the stream factory used by some middlewares.
public static getStreamFactory ( )

registerNamespace() public static method

Register a new namespace.
public static registerNamespace ( string $namespace )
$namespace string

setStreamFactory() public static method

Set the stream factory used by some middlewares.
public static setStreamFactory ( callable $streamFactory )
$streamFactory callable