/pipeline

is a lightweight and flexible implementation of the pipeline pattern for PHP applications. It provides a robust mechanism for processing HTTP requests through a chain of middleware components compliant with PSR-7 and PSR-15 standards.

Primary LanguagePHPMIT LicenseMIT

Pipeline

Psr-15 middleware pipeline

Installation

composer require bermudaphp/pipeline

Usage

use function Bermuda\Pipeline\pipe;

pipe()->pipe($myFirstMiddlewareInstance)
      ->pipe($mySecondMiddlewareInstance)
      ->process($serverRequest, $requestHandler);

Request handling

pipe([$myFirstMiddlewareInstance, $mySecondMiddlewareInstance])->handle($serverRequest);