Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/petrgrishin/pipe

Engine in your project for the integration of middleware
https://github.com/petrgrishin/pipe

middleware php pipe pipeline

Last synced: 2 months ago
JSON representation

Engine in your project for the integration of middleware

Awesome Lists containing this project

README

        

# Pipe
[![Travis CI](https://img.shields.io/travis/petrgrishin/pipe/master.svg?style=flat-square)](https://travis-ci.org/petrgrishin/pipe)
[![Coverage Status](https://img.shields.io/coveralls/petrgrishin/pipe.svg?style=flat-square)](https://coveralls.io/r/petrgrishin/pipe?branch=master)

Helper in your project for the integration of middleware

## Example of use Pipe
```php
through($accessFiltres)
->through($XSSFiltres)
->then(function (Request $request, Responce $response) {
$response->runController($request);
});
```

## Example middleware
```php
paramMiddleware = $paramMiddleware;
}

public function __invoke(Request $request, Responce $response, Closure $next) {
if ($request->isPost()) {
$response->addError('Post is forbidden');
return false;
}
return $next($request, $response);
}
}
```