alexpts/psr15-middleware-manager

Middleware manager compatible with the PSR-7 and PSR-15

1.2.0 2018-08-17 16:33 UTC

This package is auto-updated.

Last update: 2021-10-14 20:03:18 UTC


README

Build Status Code Coverage Code Climate Scrutinizer Code Quality

Middleware manager compatible with the PSR-7 and PSR-15

Installation

$ composer require alexpts/psr15-middleware-manager

Example

use PTS\PSR15\MiddlewareManager\MiddlewareManager;

$manager = new MiddlewareManager;

$manager
	->use($logMiddleware, '/admins/.*') // invoke only path /admins/.*
	->use(new RequestWithAttribute(['container' => $container]))
	->use(new RouterMiddleware);

$manager->handle($request);