You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an implementation of [PSR-15 Draft](https://github.com/php-fig/fig-standards/blob/master/proposed/http-middleware/middleware.md) using the proposed Interface package [http-interop/http-middleware](https://github.com/http-interop/http-middleware) for PHP7+ runtime environment.
4
+
This is an implementation of [PSR-15](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-15-request-handlers.md) using the proposed Interface packages [psr/http-server-middleware](https://github.com/php-fig/http-server-middleware) and [psr/http-server-handler](https://github.com/php-fig/http-server-handler) for PHP7+ runtime environment.
5
5
6
6
It enables a sequential execution of middlewares that use a PSR-7 conform Response/Request implementation.
7
7
@@ -27,22 +27,22 @@ $stack = new Stack(
27
27
$middleware3
28
28
);
29
29
30
-
$stackResponse = $stack->process($request);
30
+
$stackResponse = $stack->handle($request);
31
31
32
32
33
33
```
34
34
35
35
## Usage
36
36
**idealo/php-middleware-stack** provides the ```Idealo\Middleware\Stack``` class. All it has to know in order to be instantiable is:
37
37
* an instance of ```Psr\Http\Message\ResponseInterface``` as the default response
38
-
* and middlewares, that implement the ```Psr\Http\Middleware\ServerMiddlewareInterface```
38
+
* and middlewares, that implement the ```Psr\Http\Server\MiddlewareInterface```
39
39
40
-
To perform a sequential processing of injected middlewares you have to call stack's ```process``` method with:
41
-
* an instance of ```Psr\Http\Message\RequestInterface```.
40
+
To perform a sequential processing of injected middlewares you have to call stack's ```handle``` method with:
41
+
* an instance of ```Psr\Http\Message\ServerRequestInterface```.
42
42
43
-
By default stack's ```process``` method returns the injected response object. If any middleware decides to answer on it's own, than the response object of this certain middleware is returned.
43
+
By default stack's ```handle``` method returns the injected response object. If any middleware decides to answer on it's own, than the response object of this certain middleware is returned.
0 commit comments