From 7ba2c44135fb06ae15f306dd36082979dee5f16f Mon Sep 17 00:00:00 2001 From: Xesau Date: Fri, 7 Aug 2020 22:24:01 +0200 Subject: [PATCH] Make SessionMiddleware PSR-15 compatible --- src/SessionMiddleware.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SessionMiddleware.php b/src/SessionMiddleware.php index 2590ffe..ac235df 100644 --- a/src/SessionMiddleware.php +++ b/src/SessionMiddleware.php @@ -3,8 +3,8 @@ namespace Ojhaujjwal\Session; -use Interop\Http\ServerMiddleware\DelegateInterface; -use Interop\Http\ServerMiddleware\MiddlewareInterface; +use Psr\Http\Server\RequestHandlerInterface; +use Psr\Http\Server\MiddlewareInterface; use Ojhaujjwal\Session\Handler\HandlerInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; @@ -40,12 +40,12 @@ public function __construct(HandlerInterface $sessionHandler, array $options) * TODO: maybe, make request attribute configurable * * @param ServerRequestInterface $request - * @param DelegateInterface $delegate + * @param RequestHandlerInterface $delegate * @return ResponseInterface */ public function process( ServerRequestInterface $request, - DelegateInterface $delegate + RequestHandlerInterface $delegate ) : ResponseInterface { $sessionManager = new SessionManager($this->sessionHandler, $request, $this->options); @@ -54,7 +54,7 @@ public function process( $request = $request->withAttribute('sessionManager', $sessionManager); $request = $request->withAttribute('session', $sessionManager->getStorage()); - $response = $delegate->process($request); + $response = $delegate->handle($request); $response = $sessionManager->close($response); return $response;