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: 2024-10-15 02:34:12 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);